summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFabiano Fidencio <fabiano@fidencio.org>2011-06-21 05:55:11 +0000
committerFabiano Fidencio <fabiano@fidencio.org>2011-06-21 05:55:11 +0000
commit9ed80fe73fd78f547dbd481d1fbd4631fb50fd35 (patch)
tree13c9a8e36b59455124cc203c658787ffd334a7e7
parentb932f330bf183d5897ed51e3976a22f92339f06b (diff)
downloadenchant-9ed80fe73fd78f547dbd481d1fbd4631fb50fd35.tar.gz
Adding applespell option in build stuffs
- Now, applespell is compiled by default when an OS X system is detected - If you want to disable it in your mac, please, use --disable-applespell - Now, at least, it's building. I don't know if it's working, probably we need of more (is there?) tests. - Updating README - Many thanks, Dwayne Bailey, for all support :-). Now, could you help us to test and fix another issues with enchant? git-svn-id: svn+ssh://svn.abisource.com/svnroot/enchant/trunk@29862 bcba8976-2d24-0410-9c9c-aab3bd5fdfd6
-rw-r--r--README9
-rw-r--r--configure.in35
-rw-r--r--src/Makefile.am12
3 files changed, 49 insertions, 7 deletions
diff --git a/README b/README
index 09f59b3..b473557 100644
--- a/README
+++ b/README
@@ -9,10 +9,11 @@ dealing with different spell checking libraries.
Enchant is meant to provide a generic interface into various existing
spell checking libaries. These include, but are not limited to:
- * Aspell/Pspell
- * Ispell
- * Hspell
- * Uspell
+ * Apple Spell
+ * Aspell/Pspell
+ * Ispell
+ * Hspell
+ * Uspell
Enchant is also meant to be used in a cross-platform (XP) environment. Part
of this means that Enchant wants to limit its number of external dependencies
diff --git a/configure.in b/configure.in
index 4e83ea7..4fed9d6 100644
--- a/configure.in
+++ b/configure.in
@@ -32,6 +32,7 @@ dnl Checks for programs.
AC_ISC_POSIX
AC_PROG_CC
AC_PROG_CPP
+AC_PROG_OBJC
AC_PROG_INSTALL
AC_PROG_LN_S
AC_PROG_MAKE_SET
@@ -198,6 +199,18 @@ AC_MSG_RESULT([$native_win32])
AM_CONDITIONAL(OS_WIN32, test "x$native_win32" = "xyes")
AC_SUBST([ENCHANT_WIN32_RESOURCE])
+AC_MSG_CHECKING([for OS X])
+case ${host_os} in
+ *darwin*)
+ check_applespell=yes
+ ;;
+ *)
+ check_applespell=no
+ ;;
+esac
+AC_MSG_RESULT([$check_applespell])
+AM_CONDITIONAL(WITH_APPLESPELL, test "x$check_applespell" = "xyes")
+
AC_SUBST(SOCKET_LIBS)
# Courtesy of Glib: Ensure MSVC-compatible struct packing convention
@@ -485,6 +498,27 @@ AM_CONDITIONAL(WITH_ZEMBEREK, test "x$build_zemberek" = "xyes")
zemberek_dir=${datadir}/enchant/zemberek
+build_applespell=no
+
+APPLESPELL_CFLAGS=""
+APPLESPELL_LIBS=""
+APPLESPELL_LDFLAGS=""
+
+AC_ARG_ENABLE(applespell, AS_HELP_STRING([--disable-applespell],[enable the applespell backend @<:@default=auto@:>@]), check_applespell="$enableval", check_applespell=yes)
+
+if test "x$check_applespell" != "xno"; then
+ APPLESPELL_CFLAGS+=" -DXP_TARGET_COCOA -xobjective-c"
+ APPLESPELL_LIBS+=" -lobjc"
+ APPLESPELL_LDFLAGS+=" -framework Cocoa"
+ build_applespell=yes
+fi
+
+AC_SUBST(APPLESPELL_CFLAGS)
+AC_SUBST(APPLESPELL_LIBS)
+AC_SUBST(APPLESPELL_LDFLAGS)
+
+AM_CONDITIONAL(WITH_APPLESPELL, test "$build_applespell" = yes)
+
dnl =======================================================================================
AC_OUTPUT([
@@ -529,6 +563,7 @@ $PACKAGE-$VERSION
Build Myspell/Hunspell backend: ${build_myspell}
Build Voikko backend: ${build_voikko}
Build Zemberek backend: ${build_zemberek}
+ Build Apple Spell backend: ${build_applespell}
Build a relocatable library: ${relocatable_library}"
if test "x$build_zemberek" = "xyes"; then
diff --git a/src/Makefile.am b/src/Makefile.am
index db69beb..48ebc07 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -1,12 +1,12 @@
SUBDIRS=. aspell ispell uspell myspell hspell applespell voikko zemberek
-INCLUDES=-I$(top_srcdir) $(ENCHANT_CFLAGS) $(CC_WARN_CFLAGS) -DENCHANT_GLOBAL_MODULE_DIR=\"$(libdir)/enchant\" -DENCHANT_GLOBAL_ORDERING=\"$(datadir)/enchant\" -D_ENCHANT_BUILD=1 -DENCHANT_VERSION_STRING=\"@ENCHANT_MAJOR_VERSION@.@ENCHANT_MINOR_VERSION@.@ENCHANT_MICRO_VERSION@\"
+INCLUDES=-I$(top_srcdir) $(ENCHANT_CFLAGS) $(CC_WARN_CFLAGS) -DENCHANT_GLOBAL_MODULE_DIR=\"$(libdir)/enchant\" -DENCHANT_GLOBAL_ORDERING=\"$(datadir)/enchant\" -D_ENCHANT_BUILD=1 -DENCHANT_VERSION_STRING=\"@ENCHANT_MAJOR_VERSION@.@ENCHANT_MINOR_VERSION@.@ENCHANT_MICRO_VERSION@\" @APPLESPELL_CFLAGS@
lib_LTLIBRARIES = libenchant.la
-libenchant_la_LIBADD= $(ENCHANT_LIBS) @ENCHANT_WIN32_RESOURCE@
+libenchant_la_LIBADD= $(ENCHANT_LIBS) @ENCHANT_WIN32_RESOURCE@ @APPLESPELL_LIBS@
-libenchant_la_LDFLAGS = -no-undefined -export-dynamic
+libenchant_la_LDFLAGS = -no-undefined -export-dynamic @APPLESPELL_LDFLAGS@
if OS_WIN32
libenchant_la_LDFLAGS += -avoid-version
else
@@ -15,9 +15,15 @@ endif
libenchant_la_DEPENDENCIES = @ENCHANT_WIN32_RESOURCE@
libenchant_la_SOURCES = prefix.c enchant.c pwl.c enchant.h prefix.h pwl.h
+if WITH_APPLESPELL
+libenchant_la_SOURCES += enchant_cocoa.m enchant_cocoa.h
+endif
libenchant_includedir = $(includedir)/enchant
libenchant_include_HEADERS = enchant.h enchant-provider.h enchant++.h
+if WITH_APPLESPELL
+libenchant_include_HEADERS += enchant_cocoa.h
+endif
EXTRA_DIST=enchant.i