Hi all,
        Rex Dieter took the last step to use pkgconfig to configure libhunspell 
for autoconf. The patch follows attached (both for 2.0 and 2.1).

        FWIW the same fix should be applied to mythes detection present in 
lyxinclude.m4 but I do not feel brave enough. :-)

        We need for Fedora since libhunspell has been bumped to 1.3 and so the 
current test that searchs for libhunspell or libhunspell-1.2 fails.
-- 
José Abílio
diff -up lyx-2.0.0/config/spell.m4.hunspell_pkgconfig lyx-2.0.0/config/spell.m4
--- lyx-2.0.0/config/spell.m4.hunspell_pkgconfig	2011-03-27 16:25:24.000000000 -0500
+++ lyx-2.0.0/config/spell.m4	2011-05-26 10:48:17.539534155 -0500
@@ -51,11 +51,7 @@ AC_DEFUN([CHECK_WITH_HUNSPELL],
 	test "$with_hunspell" = "no" && lyx_use_hunspell=false
 
 	if $lyx_use_hunspell ; then
-	  AC_CHECK_HEADERS(hunspell/hunspell.hxx,
-		[AC_SEARCH_LIBS(Hunspell_spell,
-		     [hunspell hunspell-1.2],, [lyx_use_hunspell=false])],
-		[lyx_use_hunspell=false])
-	fi
+	PKG_CHECK_MODULES([HUNSPELL], [hunspell], [], [lyx_use_hunspell=false])
 	AC_MSG_CHECKING([whether to use hunspell])
 	if $lyx_use_hunspell ; then
 		AC_MSG_RESULT(yes)
@@ -64,7 +60,8 @@ AC_DEFUN([CHECK_WITH_HUNSPELL],
 	else
 		AC_MSG_RESULT(no)
 	fi
-	])
+    fi
+    ])
 
 
 ### Check if we want spell libraries, prefer new aspell or hunspell
diff -up lyx-2.0.0/src/HunspellChecker.cpp.hunspell_pkgconfig lyx-2.0.0/src/HunspellChecker.cpp
diff -up lyx-2.0.0/src/Makefile.am.hunspell_pkgconfig lyx-2.0.0/src/Makefile.am
--- lyx-2.0.0/src/Makefile.am.hunspell_pkgconfig	2011-02-10 18:02:05.000000000 -0600
+++ lyx-2.0.0/src/Makefile.am	2011-05-26 10:51:37.282467840 -0500
@@ -4,7 +4,7 @@ include $(top_srcdir)/config/common.am
 
 DISTCLEANFILES += libintl.h
 
-AM_CPPFLAGS += $(PCH_FLAGS) -I$(top_srcdir)/src $(BOOST_INCLUDES) $(ENCHANT_CFLAGS)
+AM_CPPFLAGS += $(PCH_FLAGS) -I$(top_srcdir)/src $(BOOST_INCLUDES) $(ENCHANT_CFLAGS) $(HUNSPELL_CFLAGS)
 AM_CPPFLAGS += $(QT4_CPPFLAGS) $(QT4_CORE_INCLUDES)
 
 if BUILD_CLIENT_SUBDIR
@@ -16,7 +16,7 @@ SUBDIRS = support frontends . $(CLIENT) 
 EXTRA_DIST = pch.h
 
 OTHERLIBS = $(BOOST_LIBS) $(INTLLIBS) $(MYTHES_LIBS) \
-		 $(ENCHANT_LIBS) @LIBS@ $(SOCKET_LIBS) $(LIBSHLWAPI) $(LIBPSAPI)
+		 $(ENCHANT_LIBS) $(HUNSPELL_LIBS) @LIBS@ $(SOCKET_LIBS) $(LIBSHLWAPI) $(LIBPSAPI)
 
 noinst_LIBRARIES = liblyxcore.a
 bin_PROGRAMS = lyx

Reply via email to