* LyXRC.cpp:
[lyx.git] / config / spell.m4
blobbcb6f0a6fde8f748f363191522368c59e65577db
1 # Macro to add for using aspell spellchecker libraries!     -*- sh -*-
2 # Only checks for "new" aspell, > 0.50
3 AC_DEFUN([CHECK_WITH_ASPELL],
5         lyx_use_aspell=true
6         AC_ARG_WITH(aspell,     AC_HELP_STRING([--with-aspell],[use ASpell libraries]))
7         test "$with_aspell" = "no" && lyx_use_aspell=false
9         if $lyx_use_aspell ; then
10         AC_CHECK_HEADERS(aspell.h,
11                 [lyx_use_aspell=true; break;],
12                 [lyx_use_aspell=false])
13         AC_CHECK_LIB(aspell, new_aspell_config, LIBS="-laspell $LIBS", lyx_use_aspell=false)
15         AC_MSG_CHECKING([whether to use aspell])
16         if $lyx_use_aspell ; then
17                 AC_MSG_RESULT(yes)
18                 AC_DEFINE(USE_ASPELL, 1, [Define as 1 to use the aspell library])
19                 lyx_flags="$lyx_flags use-aspell"
20         else
21                 AC_MSG_RESULT(no)
22         fi
23         fi
24         ])
26 # Macro to add for using hunspell spellchecker libraries!     -*- sh -*-
27 AC_DEFUN([CHECK_WITH_HUNSPELL],
29         lyx_use_hunspell=true
30         AC_ARG_WITH(hunspell,   AC_HELP_STRING([--with-hunspell],[use Hunspell libraries]))
31         test "$with_hunspell" = "no" && lyx_use_hunspell=false
33         if $lyx_use_hunspell ; then
34         AC_CHECK_HEADERS(hunspell/hunspell.hxx,
35                 [lyx_use_hunspell=true; break;],
36                 [lyx_use_hunspell=false])
37         AC_CHECK_LIB(hunspell, main, LIBS="-lhunspell $LIBS", lyx_use_hunspell=false)
39         AC_MSG_CHECKING([whether to use hunspell])
40         if $lyx_use_hunspell ; then
41                 AC_MSG_RESULT(yes)
42                 AC_DEFINE(USE_HUNSPELL, 1, [Define as 1 to use the hunspell library])
43                 lyx_flags="$lyx_flags use-hunspell"
44         else
45                 AC_MSG_RESULT(no)
46         fi
47         fi
48         ])
50 ### Check if we want spell libraries, prefer new aspell or hunspell
51 AC_DEFUN([LYX_CHECK_SPELL_ENGINES],
53         lyx_use_aspell=false
54         CHECK_WITH_ASPELL
56         AM_CONDITIONAL(USE_ASPELL, $lyx_use_aspell)
58         lyx_use_hunspell=false
59         CHECK_WITH_HUNSPELL
61         AM_CONDITIONAL(USE_HUNSPELL, $lyx_use_hunspell)
62         ])