]> git.lyx.org Git - lyx.git/blob - config/spell.m4
Fix some issues with textmode. We'll let SetMode() handle as much of
[lyx.git] / config / spell.m4
1 # Macro to add for using aspell spellchecker libraries!     -*- sh -*-
2 # Only checks for "new" aspell, > 0.50
3 AC_DEFUN([CHECK_WITH_ASPELL],
4 [
5         lyx_use_aspell=true
6         AC_ARG_WITH(aspell, AC_HELP_STRING([--without-aspell],[do not check for ASpell library]))
7         test "$with_aspell" = "no" && lyx_use_aspell=false
8
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)
14
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         ])
25
26 # Macro to add for using hunspell spellchecker libraries!     -*- sh -*-
27 AC_DEFUN([CHECK_WITH_HUNSPELL],
28 [
29         lyx_use_hunspell=true
30         AC_ARG_WITH(hunspell, AC_HELP_STRING([--without-hunspell],[do not check for Hunspell library]))
31         test "$with_hunspell" = "no" && lyx_use_hunspell=false
32
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)
38
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         ])
49
50 ### Check if we want spell libraries, prefer new aspell or hunspell
51 AC_DEFUN([LYX_CHECK_SPELL_ENGINES],
52 [
53         lyx_use_aspell=false
54         CHECK_WITH_ASPELL
55
56         AM_CONDITIONAL(USE_ASPELL, $lyx_use_aspell)
57
58         lyx_use_hunspell=false
59         CHECK_WITH_HUNSPELL
60
61         AM_CONDITIONAL(USE_HUNSPELL, $lyx_use_hunspell)
62         ])