1 # Macro to add for using aspell spellchecker libraries! -*- sh -*-
2 # Only checks for "new" aspell, > 0.50
3 AC_DEFUN([CHECK_WITH_ASPELL],
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
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
18 AC_DEFINE(USE_ASPELL, 1, [Define as 1 to use the aspell library])
19 lyx_flags="$lyx_flags use-aspell"
26 # Macro to add for using enchant spellchecker libraries! -*- sh -*-
27 AC_DEFUN([CHECK_WITH_ENCHANT],
30 AC_ARG_WITH(enchant, AC_HELP_STRING([--without-enchant],[do not check for Enchant library]))
31 test "$with_enchant" = "no" && lyx_use_enchant=false
33 if $lyx_use_enchant; then
34 PKG_CHECK_MODULES([ENCHANT], [enchant], [], [lyx_use_enchant=false])
35 AC_MSG_CHECKING([whether to use enchant])
36 if $lyx_use_enchant ; then
38 AC_DEFINE(USE_ENCHANT, 1, [Define as 1 to use the enchant library])
39 lyx_flags="$lyx_flags use-enchant"
46 # Macro to add for using hunspell spellchecker libraries! -*- sh -*-
47 AC_DEFUN([CHECK_WITH_HUNSPELL],
50 AC_ARG_WITH(hunspell, AC_HELP_STRING([--without-hunspell],[do not check for Hunspell library]))
51 test "$with_hunspell" = "no" && lyx_use_hunspell=false
53 if $lyx_use_hunspell ; then
54 AC_CHECK_HEADERS(hunspell/hunspell.hxx,
55 [lyx_use_hunspell=true; break;],
56 [lyx_use_hunspell=false])
57 AC_CHECK_LIB(hunspell, main, LIBS="-lhunspell $LIBS", lyx_use_hunspell=false)
59 AC_MSG_CHECKING([whether to use hunspell])
60 if $lyx_use_hunspell ; then
62 AC_DEFINE(USE_HUNSPELL, 1, [Define as 1 to use the hunspell library])
63 lyx_flags="$lyx_flags use-hunspell"
71 ### Check if we want spell libraries, prefer new aspell or hunspell
72 AC_DEFUN([LYX_CHECK_SPELL_ENGINES],
75 AM_CONDITIONAL(USE_ASPELL, $lyx_use_aspell)
78 AM_CONDITIONAL(USE_ENCHANT, $lyx_use_enchant)
81 AM_CONDITIONAL(USE_HUNSPELL, $lyx_use_hunspell)