]> git.lyx.org Git - lyx.git/blob - config/pspell.m4
update boost
[lyx.git] / config / pspell.m4
1 # Macro to add for using pspell spellchecker libraries!     -*- sh -*-
2 # @author@: Jürgen Vigna
3
4 AC_DEFUN(CHECK_WITH_PSPELL,
5 [
6   USE_PSPELL="no"
7   AC_MSG_CHECKING([for pspell support])
8     AC_ARG_WITH(pspell,
9       [  --with-pspell           use PSpell libraries],[
10         if test "$withval" != "no"; then
11           USE_PSPELL="yes"
12         fi
13       ])
14
15     AC_ARG_WITH(pspell-includes, [  --with-pspell-include   where the pspell.h is located],
16       pspell_use_include="$withval",
17       pspell_use_include=NONE)
18
19     if test "$pspell_use_include" = "" || \
20       test "$pspell_use_include" = "NONE"; then
21       pspell_includes="/usr/include /usr/local/include"
22       AC_FIND_FILE(pspell/pspell.h,$pspell_includes,pspell_use_include)
23     fi
24
25     AC_ARG_WITH(pspell-libs, [  --with-pspell-lib       where the libpspell.a is located],
26       pspell_use_lib="$withval",
27       pspell_use_lib=NONE)
28
29     if test -n "$pspell_use_lib" && \
30       test "$pspell_use_lib" != "NONE"; then
31       pspell_lib_found="Setting to $pspell_use_lib"
32     else
33       pspell_libs="/usr/lib /usr/lib/pspell /usr/local/lib /usr/local/lib/pspell"
34       AC_FIND_FILE(libpspell.la libpspell.so libpspell.a,$pspell_libs,pspell_use_lib)
35       pspell_lib_found="yes"
36     fi
37
38     if test "$pspell_use_include" = "NO" || \
39        test "$pspell_use_lib" = "NO"; then
40       if test "$USE_PSPELL" = "yes"; then
41         USE_PSPELL="not found"
42       fi
43     fi
44
45     if test "$USE_PSPELL" = "yes"; then
46       AC_DEFINE(USE_PSPELL, 1, [Define as 1 to use the pspell library])
47       PSPELL_INCLUDES="-I$pspell_use_include"
48       PSPELL_LIBS="-L$pspell_use_lib -lpspell"
49       USE_PSPELL="yes ($pspell_use_include $pspell_use_lib)"
50       AC_SUBST(PSPELL_INCLUDES)
51       AC_SUBST(PSPELL_LIBS)
52       lyx_flags="$lyx_flags use-pspell"
53     fi
54     AC_MSG_RESULT($USE_PSPELL)
55   ])