]> git.lyx.org Git - lyx.git/blobdiff - config/spell.m4
Get rid of LYX_ERROR in our configure file.
[lyx.git] / config / spell.m4
index d8b643cc841fb582f3ce3a7d3402e9a556971e71..1a2a1e9522fd68d3741ddf6824c2be595844f97a 100644 (file)
@@ -51,16 +51,12 @@ AC_DEFUN([CHECK_WITH_HUNSPELL],
        test "$with_hunspell" = "no" && lyx_use_hunspell=false
 
        if $lyx_use_hunspell ; then
-       AC_CHECK_HEADERS(hunspell/hunspell.hxx,
-               [lyx_use_hunspell=true; break;],
-               [lyx_use_hunspell=false])
-
-       if test x$lyx_use_hunspell = xtrue ; then
-               AC_CHECK_LIB(hunspell, main, LIBS="-lhunspell $LIBS", lyx_use_hunspell=false)
-               if test x$lyx_use_hunspell = xfalse ; then
-                        AC_CHECK_LIB(hunspell-1.2, main, [LIBS="-lhunspell-1.2 $LIBS" lyx_use_hunspell=true], lyx_use_hunspell=false)
-               fi
-       fi
+       PKG_CHECK_MODULES([HUNSPELL], [hunspell], [], [
+                 AC_CHECK_HEADERS(hunspell/hunspell.hxx,
+                   [lyx_use_hunspell=true; break;],
+                        [lyx_use_hunspell=false])
+                        AC_CHECK_LIB(hunspell, main, LIBS="-lhunspell $LIBS", lyx_use_hunspell=false)
+               ])
        AC_MSG_CHECKING([whether to use hunspell])
        if $lyx_use_hunspell ; then
                AC_MSG_RESULT(yes)
@@ -69,8 +65,8 @@ AC_DEFUN([CHECK_WITH_HUNSPELL],
        else
                AC_MSG_RESULT(no)
        fi
-       fi
-       ])
+    fi
+    ])
 
 
 ### Check if we want spell libraries, prefer new aspell or hunspell