Jean-Marc,
I tried to take your spelling ideas further, but have failed. What I think
I'd like is for config.h to contain
/* Define as "ASPELL", "PSPELL" or "ISPELL" to specify the spell-checker.*/
#define SPELL_ENGINE "ASPELL"
But at the moment I get
#define SPELL_ENGINE lyx_spell_engine
because I don't know how to pass the value stored by lyx_spell_engine to
AC_DEFINE. Currently I have:
AC_DEFINE(SPELL_ENGINE, [$lyx_spell_engine], [Define as "ASPELL", "PSPELL"
or "ISPELL" to specify the spell-checker.])
I also wonder how best to add one of
aspell.C aspell.h
pspell.C pspell.h
ispell.C ispell.h
to the SOURCES of src/Makefile.am
Do I need three separate
AM_CONDITIONAL(USE_ASPELL, $use_aspell)
AM_CONDITIONAL(USE_PSPELL, $use_pspell)
AM_CONDITIONAL(USE_ISPELL, $use_ispell)
or can I define a single variable and get Makefile.am to interrogate it?
--
Angus
Index: configure.ac
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/configure.ac,v
retrieving revision 1.47
diff -u -p -r1.47 configure.ac
--- configure.ac 11 Mar 2005 10:49:09 -0000 1.47
+++ configure.ac 27 Apr 2005 17:34:30 -0000
@@ -289,6 +289,37 @@ dnl We aim to remove this eventually, si
dnl possible with the compiler which will use the functions (JMarc)
AC_LANG_PUSH(C)
AC_CHECK_FUNCS(mkfifo mkstemp mktemp lstat readlink)
+
+lyx_spell_engine=""
+if test "$USING_ASPELL" = "yes"; then
+ lyx_flags="$lyx_flags use-aspell"
+ lyx_spell_engine="ASPELL"
+
+elif test "$USING_PSPELL" = "yes"; then
+ lyx_flags="$lyx_flags use-pspell"
+ lyx_spell_engine="PSPELL"
+
+else
+ lyx_use_ispell=true
+ AC_CHECK_FUNCS(select dup2,, [lyx_use_ispell=false])
+ AC_MSG_CHECKING([whether to use ispell])
+ if $lyx_use_ispell ; then
+ AC_MSG_RESULT(yes)
+ lyx_flags="$lyx_flags use-ispell"
+ lyx_spell_engine="ISPELL"
+ else
+ AC_MSG_RESULT(no)
+ fi
+fi
+
+AC_DEFINE(SPELL_ENGINE, [lyx_spell_engine], [Define as "ASPELL", "PSPELL" or "ISPELL" to specify the spell-checker.])
+
+##AM_CONDITIONAL(USE_ISPELL, $lyx_use_ispell)
+
+lyx_client_subdir=true
+AC_CHECK_FUNCS(select socket,, [lyx_client_subdir=false])
+AM_CONDITIONAL(BUILD_CLIENT_SUBDIR, $lyx_client_subdir)
+
AC_LANG_POP(C)
AC_FUNC_SELECT_ARGTYPES
Index: config/aspell.m4
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/config/aspell.m4,v
retrieving revision 1.2
diff -u -p -r1.2 aspell.m4
--- config/aspell.m4 25 May 2004 14:42:08 -0000 1.2
+++ config/aspell.m4 27 Apr 2005 17:34:30 -0000
@@ -19,11 +19,6 @@ AC_DEFUN([CHECK_WITH_ASPELL],
if test "$USING_ASPELL" = "yes" ; then
AC_CHECK_HEADERS(aspell.h aspell/aspell.h, USING_ASPELL="yes", USING_ASPELL="no")
AC_CHECK_LIB(aspell, new_aspell_config, LIBS="-laspell $LIBS"; USING_ASPELL="yes", USING_ASPELL="no")
-
- if test "$USING_ASPELL" = "yes"; then
- AC_DEFINE(USE_ASPELL, 1, [Define as 1 to use the aspell library])
- lyx_flags="$lyx_flags use-aspell"
- fi
fi
AC_MSG_CHECKING([whether to use aspell])
AC_MSG_RESULT($USING_ASPELL)
Index: config/pspell.m4
===================================================================
RCS file: /usr/local/lyx/cvsroot/lyx-devel/config/pspell.m4,v
retrieving revision 1.10
diff -u -p -r1.10 pspell.m4
--- config/pspell.m4 25 May 2004 14:42:09 -0000 1.10
+++ config/pspell.m4 27 Apr 2005 17:34:30 -0000
@@ -18,11 +18,6 @@ AC_DEFUN([CHECK_WITH_PSPELL],
if test "$USING_PSPELL" = "yes" ; then
AC_CHECK_HEADERS(pspell/pspell.h, USING_PSPELL="yes", USING_PSPELL="no")
AC_CHECK_LIB(pspell, main, LIBS="-lpspell $LIBS"; USING_PSPELL="yes", USING_PSPELL="no")
-
- if test "$USING_PSPELL" = "yes"; then
- AC_DEFINE(USE_PSPELL, 1, [Define as 1 to use the pspell library])
- lyx_flags="$lyx_flags use-pspell"
- fi
fi
AC_MSG_CHECKING([whether to use pspell])
AC_MSG_RESULT($USING_PSPELL)