soc.2008.finch: da4faa17: Added auto-foo detection of Enchant.

queueram at soc.pidgin.im queueram at soc.pidgin.im
Tue Jun 3 01:01:48 EDT 2008


-----------------------------------------------------------------
Revision: da4faa173bbbcd17d723617fb0925eba18812f0c
Ancestor: ad64c39d6dbc5c885a5d853ceb9c37c8433da09b
Author: queueram at soc.pidgin.im
Date: 2008-06-03T04:57:12
Branch: im.pidgin.soc.2008.finch
URL: http://d.pidgin.im/viewmtn/revision/info/da4faa173bbbcd17d723617fb0925eba18812f0c

Modified files:
        finch/libgnt/Makefile.am finch/libgnt/configure.ac
        finch/libgnt/gntentry.c finch/libgnt/gntentry.h

ChangeLog: 

Added auto-foo detection of Enchant.

-------------- next part --------------
============================================================
--- finch/libgnt/Makefile.am	bbfc5139add07f7c22fd1161478b3494ce6a99ba
+++ finch/libgnt/Makefile.am	73b0dc7e6ddb01417b2d5d490c17e660c6b50f0b
@@ -85,6 +85,7 @@ libgnt_la_LIBADD = \
 	$(GLIB_LIBS) \
 	$(GNT_LIBS) \
 	$(LIBXML_LIBS) \
+	$(ENCHANT_LIBS) \
 	$(PY_LIBS)
 
 AM_CPPFLAGS = \
@@ -92,4 +93,5 @@ AM_CPPFLAGS = \
 	$(GNT_CFLAGS) \
 	$(DEBUG_CFLAGS) \
 	$(LIBXML_CFLAGS) \
+	$(ENCHANT_CFLAGS) \
 	$(PY_CFLAGS)
============================================================
--- finch/libgnt/configure.ac	76f0a4f392a1259fcd94fccdf14cd608ccbe7902
+++ finch/libgnt/configure.ac	7df76f1182cb8bfe033e26322744b071ff1bdd4f
@@ -343,6 +343,34 @@ fi
 	AC_DEFINE(NO_LIBXML, 1, [Do not have libxml2.])
 fi
 
+dnl Check for Enchant for spell checking
+dnl (Thanks to gedit)
+AC_ARG_ENABLE([spell],
+  AS_HELP_STRING([--disable-spell],[Disable spell plugin (default: enabled)]),
+  [enable_enchant=$enableval],
+  [enable_enchant=yes])
+ 
+if test "x$enable_enchant" = "xyes" ; then
+ 
+  PKG_CHECK_MODULES(ENCHANT, [enchant >= 1.3.0], \
+       have_enchant=yes, have_enchant=no)
+ 
+  if test "x$have_enchant" = "xyes"; then
+ 
+    ENCHANT_CFLAGS="${ENCHANT_CFLAGS}"
+    ENCHANT_LIBS="${ENCHANT_LIBS}"
+	AC_DEFINE(USE_ENCHANT, 1, [Define if enchant spell checking is enabled.])
+  else
+    AC_MSG_ERROR([Enchant library not found or too old. Use --disable-spell to build without spell plugin.])
+  fi
+else
+  ENCHANT_CFLAGS=
+  ENCHANT_LIBS=
+fi
+ 
+AC_SUBST(ENCHANT_CFLAGS)
+AC_SUBST(ENCHANT_LIBS)
+
 AM_CONDITIONAL(PURPLE_AVAILABLE, false)
 
 AC_OUTPUT([Makefile
============================================================
--- finch/libgnt/gntentry.c	409b2a8083832ceabed8382936fed2a3098ba182
+++ finch/libgnt/gntentry.c	a2c56a5d83f1b68e732f2a28fd938d491926ab87
@@ -20,6 +20,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
 
+#include "config.h"
+
 #include <ctype.h>
 #include <string.h>
 
============================================================
--- finch/libgnt/gntentry.h	4e901a7eab6c51a30ccb4ea88fbd5177387c719c
+++ finch/libgnt/gntentry.h	46cb5604468a05802f56d35525e1321d6a64a50e
@@ -45,9 +45,6 @@
 
 #define	ENTRY_CHAR		'_'			/* The character to use to fill in the blank places */
 
-/* XXX: HACK */
-#define USE_ENCHANT
-
 typedef struct _GntEntry			GntEntry;
 typedef struct _GntEntryPriv		GntEntryPriv;
 typedef struct _GntEntryClass	GntEntryClass;


More information about the Commits mailing list