summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorReuben Thomas <rrt@sc3d.org>2017-02-09 13:48:29 +0000
committerReuben Thomas <rrt@sc3d.org>2017-02-09 14:42:18 +0000
commitd2b9f6e6ff1c2f7c68d3c21069c2f57e0685bce5 (patch)
tree20c35ff0de3a41d621d70c281f85a2bfecbad119
parent3f8133b65914379bb35ac2673735a441fec4e436 (diff)
downloadenchant-d2b9f6e6ff1c2f7c68d3c21069c2f57e0685bce5.tar.gz
Clarify and improve spell-checker detection
Add a header comment for each spell checker Use pkg-config to detect libvoikko Restore ability to disable myspell (removed recently when pkg-config used)
-rw-r--r--appveyor.yml2
-rw-r--r--configure.ac54
-rw-r--r--src/voikko/Makefile.am2
3 files changed, 28 insertions, 30 deletions
diff --git a/appveyor.yml b/appveyor.yml
index 1b25d16..8c9e135 100644
--- a/appveyor.yml
+++ b/appveyor.yml
@@ -3,7 +3,7 @@ clone_folder: c:\projects\enchant
environment:
global:
- CONFIGURE_FLAGS: --with-myspell-dir=/mingw64/share/hunspell
+ CONFIGURE_FLAGS: --with-myspell-dir=/mingw64/share/hunspell --disable-voikko
VERBOSE: 1 # Get test logs in output
# FIXME: Build on mingw-w64, mingw-w32 and MSYS2
diff --git a/configure.ac b/configure.ac
index de92b5b..85ffc74 100644
--- a/configure.ac
+++ b/configure.ac
@@ -313,6 +313,10 @@ dnl supporting this old version.
AC_SUBST(UNITTESTPP_CFLAGS)
AC_SUBST(UNITTESTPP_LIBS)
+
+dnl =======================================================================================
+
+dnl Ispell
build_ispell=yes
AC_ARG_ENABLE(ispell, AS_HELP_STRING([--disable-ispell],[enable the ispell backend @<:@default=auto@:>@]), build_ispell="$enableval", build_ispell=yes)
@@ -329,24 +333,27 @@ fi
ISPELL_CFLAGS="-DENCHANT_ISPELL_DICT_DIR='\"$ispell_dir\"'"
AC_SUBST(ISPELL_CFLAGS)
-build_myspell=yes
+dnl Hunspell
AC_ARG_ENABLE(myspell, AS_HELP_STRING([--disable-myspell],[enable the myspell backend @<:@default=auto@:>@]), build_myspell="$enableval", build_myspell=yes)
AM_CONDITIONAL(WITH_MYSPELL, test "x$build_myspell" = "xyes")
myspell_dir=${datadir}/myspell/dicts
AC_ARG_WITH(myspell-dir, AS_HELP_STRING([--with-myspell-dir=PATH],[path to installed myspell dicts]))
-
if test "x$with_myspell_dir" != "x" ; then
myspell_dir=$with_myspell_dir
fi
-PKG_CHECK_MODULES(MYSPELL, [hunspell])
-AC_SUBST(MYSPELL_CFLAGS)
-AC_SUBST(MYSPELL_LIBS)
-MYSPELL_CFLAGS="$MYSPELL_CFLAGS -DENCHANT_MYSPELL_DICT_DIR='\"$myspell_dir\"'"
+if test "x$build_myspell" = xyes; then
+ PKG_CHECK_MODULES(MYSPELL, [hunspell])
+ AC_SUBST(MYSPELL_CFLAGS)
+ AC_SUBST(MYSPELL_LIBS)
+ MYSPELL_CFLAGS="$MYSPELL_CFLAGS -DENCHANT_MYSPELL_DICT_DIR='\"$myspell_dir\"'"
+fi
+
+dnl Aspell
check_aspell=yes
build_aspell=no
@@ -408,36 +415,21 @@ fi
AM_CONDITIONAL(WITH_ASPELL, test "$build_aspell" = yes)
-check_voikko=yes
-build_voikko=no
-
-AC_ARG_ENABLE(voikko, AS_HELP_STRING([--disable-voikko],[enable the voikko backend @<:@default=auto@:>@]), check_voikko="$enableval", check_voikko=yes)
-AC_ARG_WITH(voikko-prefix, AS_HELP_STRING([--with-voikko-prefix=DIR],[specify under which prefix voikko is installed]), voikko_prefix="$withval", )
+dnl Voikko
+AC_ARG_ENABLE(voikko, AS_HELP_STRING([--disable-voikko],[enable the voikko backend @<:@default=auto@:>@]), build_voikko="$enableval", build_voikko=yes)
-if test "x$check_voikko" != "xno"; then
- saved_LDFLAGS=$LDFLAGS
+AM_CONDITIONAL(WITH_VOIKKO, test "x$build_voikko" = "xyes")
- VOIKKO_INC=
- VOIKKO_LIBS="-lvoikko"
- if test "x$voikko_prefix" != "x"; then
- LDFLAGS="-L$voikko_prefix/lib "$LDFLAGS
- VOIKKO_INC="-I$voikko_prefix/include"
- VOIKKO_LIBS="-L$voikko_prefix/lib "$VOIKKO_LIBS
- fi
-
- AC_CHECK_LIB(voikko,voikko_init,build_voikko=yes)
-
- LDFLAGS=$saved_LDFLAGS
-
- AC_SUBST(VOIKKO_INC)
+if test "x$build_voikko" = xyes; then
+ PKG_CHECK_MODULES(VOIKKO, [libvoikko])
+ AC_SUBST(VOIKKO_CFLAGS)
AC_SUBST(VOIKKO_LIBS)
fi
-AM_CONDITIONAL(WITH_VOIKKO, test "$build_voikko" = yes)
+dnl Uspell
build_uspell=no
-
check_uspell=yes
AC_ARG_ENABLE(uspell, AS_HELP_STRING([--disable-uspell],[enable the uspell backend @<:@default=auto@:>@]), check_uspell="$enableval", check_uspell=yes)
@@ -458,6 +450,8 @@ AC_SUBST(USPELL_LIBS)
AM_CONDITIONAL(WITH_USPELL, test "$build_uspell" = yes)
+
+dnl Hspell
build_hspell=no
check_hspell=yes
AC_ARG_ENABLE(hspell, AS_HELP_STRING([--disable-hspell],[enable the hspell backend @<:@default=auto@:>@]), check_hspell="$enableval", check_hspell=yes)
@@ -487,6 +481,8 @@ fi
AM_CONDITIONAL(WITH_HSPELL, test "$build_hspell" = yes)
+
+dnl Zemberek
build_zemberek=no
AC_ARG_ENABLE(zemberek, AS_HELP_STRING([--enable-zemberek],[enable the experimental zemberek (turkish) backend @<:@default=auto@:>@]), build_zemberek="$enableval", build_zemberek=no)
@@ -500,6 +496,8 @@ AM_CONDITIONAL(WITH_ZEMBEREK, test "x$build_zemberek" = "xyes")
zemberek_dir=${datadir}/enchant/zemberek
+
+dnl Apple Spell
APPLESPELL_CFLAGS=""
APPLESPELL_LIBS=""
APPLESPELL_LDFLAGS=""
diff --git a/src/voikko/Makefile.am b/src/voikko/Makefile.am
index 3cda61a..739c36a 100644
--- a/src/voikko/Makefile.am
+++ b/src/voikko/Makefile.am
@@ -4,7 +4,7 @@ else
target_lib =
endif
-AM_CPPFLAGS=-I$(top_srcdir)/src $(ENCHANT_CFLAGS) $(CC_WARN_CFLAGS) @VOIKKO_INC@ -D_ENCHANT_BUILD=1
+AM_CPPFLAGS=-I$(top_srcdir)/src $(ENCHANT_CFLAGS) $(CC_WARN_CFLAGS) $(VOIKKO_CFLAGS) -D_ENCHANT_BUILD=1
voikko_LTLIBRARIES = $(target_lib)
voikkodir= $(libdir)/enchant