+AC_DEFUN([LYX_HAVE_HUNSPELL_CXXABI],
+[
+ AC_MSG_CHECKING([whether hunspell C++ (rather than C) ABI is provided])
+ save_CXXFLAGS=$CXXFLAGS
+ CXXFLAGS="$ENCHANT_CFLAGS $AM_CXXFLAGS $CXXFLAGS"
+
+# in the C++ ABI, stem() returns a vector, in the C ABI, it returns an int
+ AC_TRY_COMPILE([#include <hunspell/hunspell.hxx>],
+ [Hunspell sp("foo", "bar");
+ int i = sp.stem("test").size();],
+ [AC_MSG_RESULT(yes)
+ AC_DEFINE(HAVE_HUNSPELL_CXXABI, 1, [Define to 1 if hunspell C++ (rather than C) ABI is detected])
+ have_hunspell_cxx_abi=yes
+ ],
+ [AC_MSG_RESULT(no)])
+ CXXFLAGS=$save_CXXFLAGS
+])
+