aspell: fix compilation with enchant version older than 1.6.0 (closes #192)
This commit is contained in:
parent
6a118ce940
commit
6860aa491f
@ -37,6 +37,7 @@ http://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
|
||||
* tests: fix build of tests when the build directory is outside source tree
|
||||
(closes #178)
|
||||
* tests: fix memory leak in tests launcher
|
||||
* aspell: fix compilation with enchant version older than 1.6.0 (closes #192)
|
||||
* aspell: fix crash with command "/aspell addword" if no word is given
|
||||
(closes #164, closes #165)
|
||||
* irc: fix translation of CTCP PING reply (closes #137)
|
||||
|
@ -42,12 +42,14 @@ find_library(ASPELL_LIBRARY
|
||||
)
|
||||
|
||||
if(ASPELL_INCLUDE_PATH AND ASPELL_LIBRARY)
|
||||
set(ASPELL_FOUND TRUE)
|
||||
|
||||
# check if function aspell_version_string() exists
|
||||
set(CMAKE_REQUIRED_INCLUDES ${ASPELL_INCLUDE_PATH})
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${ASPELL_LIBRARY})
|
||||
check_symbol_exists(aspell_version_string "aspell.h" HAVE_ASPELL_VERSION_STRING)
|
||||
set(CMAKE_REQUIRED_INCLUDES)
|
||||
set(CMAKE_REQUIRED_LIBRARIES)
|
||||
set(ASPELL_FOUND TRUE)
|
||||
endif()
|
||||
|
||||
mark_as_advanced(
|
||||
|
@ -41,4 +41,11 @@ else()
|
||||
|
||||
mark_as_advanced(ENCHANT_INCLUDE_DIR ENCHANT_LIBRARIES)
|
||||
|
||||
# check if function enchant_get_version() exists
|
||||
set(CMAKE_REQUIRED_INCLUDES ${ENCHANT_INCLUDE_DIR})
|
||||
set(CMAKE_REQUIRED_LIBRARIES ${ENCHANT_LIBRARIES})
|
||||
check_symbol_exists(enchant_get_version "enchant.h" HAVE_ENCHANT_GET_VERSION)
|
||||
set(CMAKE_REQUIRED_INCLUDES)
|
||||
set(CMAKE_REQUIRED_LIBRARIES)
|
||||
|
||||
endif()
|
||||
|
@ -7,6 +7,7 @@
|
||||
#cmakedefine HAVE_MALLINFO
|
||||
#cmakedefine HAVE_EAT_NEWLINE_GLITCH
|
||||
#cmakedefine HAVE_ASPELL_VERSION_STRING
|
||||
#cmakedefine HAVE_ENCHANT_GET_VERSION
|
||||
#define PACKAGE_VERSION "@VERSION@"
|
||||
#define PACKAGE "@PROJECT_NAME@"
|
||||
#define PACKAGE_NAME "@PROJECT_NAME@"
|
||||
|
20
configure.ac
20
configure.ac
@ -102,6 +102,7 @@ AH_VERBATIM([HAVE_GNUTLS], [#undef HAVE_GNUTLS])
|
||||
AH_VERBATIM([HAVE_FLOCK], [#undef HAVE_FLOCK])
|
||||
AH_VERBATIM([HAVE_EAT_NEWLINE_GLITCH], [#undef HAVE_EAT_NEWLINE_GLITCH])
|
||||
AH_VERBATIM([HAVE_ASPELL_VERSION_STRING], [#undef HAVE_ASPELL_VERSION_STRING])
|
||||
AH_VERBATIM([HAVE_ENCHANT_GET_VERSION], [#undef HAVE_ENCHANT_GET_VERSION])
|
||||
AH_VERBATIM([PLUGIN_ALIAS], [#undef PLUGIN_ALIAS])
|
||||
AH_VERBATIM([PLUGIN_ASPELL], [#undef PLUGIN_ASPELL])
|
||||
AH_VERBATIM([PLUGIN_CHARSET], [#undef PLUGIN_CHARSET])
|
||||
@ -307,6 +308,23 @@ if test "x$enable_aspell" = "xyes" ; then
|
||||
if test "x$ac_found_enchant_lib" = "xyes" ; then
|
||||
CFLAGS="$CFLAGS -DUSE_ENCHANT"
|
||||
ASPELL_LIB_USED="enchant"
|
||||
|
||||
# check if function enchant_get_version() exists
|
||||
ac_save_CFLAGS="$CFLAGS"
|
||||
ac_save_LDFLAGS="$LDFLAGS"
|
||||
CFLAGS="$CFLAGS $ENCHANT_CFLAGS"
|
||||
LDFLAGS="$LDFLAGS $ENCHANT_LIBS"
|
||||
AC_CACHE_CHECK([for enchant_get_version() support], ac_cv_have_enchant_get_version, [
|
||||
AC_LINK_IFELSE([AC_LANG_PROGRAM(
|
||||
[[ #include <enchant.h>]],
|
||||
[[ const char *version = enchant_get_version(); ]])],
|
||||
[ ac_have_enchant_get_version="yes" ],
|
||||
[ ac_have_enchant_get_version="no" ])])
|
||||
CFLAGS="$ac_save_CFLAGS"
|
||||
LDFLAGS="$ac_save_LDFLAGS"
|
||||
if test "x$ac_have_enchant_get_version" = "xyes"; then
|
||||
AC_DEFINE(HAVE_ENCHANT_GET_VERSION)
|
||||
fi
|
||||
else
|
||||
ASPELL_CFLAGS=""
|
||||
ASPELL_LFLAGS=""
|
||||
@ -327,6 +345,8 @@ if test "x$enable_aspell" = "xyes" ; then
|
||||
AC_MSG_RESULT(yes)
|
||||
ASPELL_LFLAGS="$ASPELL_LFLAGS -laspell"
|
||||
ASPELL_LIB_USED="aspell"
|
||||
|
||||
# check if function aspell_version_string() exists
|
||||
ac_save_LDFLAGS="$LDFLAGS"
|
||||
LDFLAGS="$LDFLAGS $ASPELL_LFLAGS"
|
||||
AC_CACHE_CHECK([for aspell_version_string() support], ac_cv_have_aspell_version_string, [
|
||||
|
@ -1002,15 +1002,19 @@ weechat_aspell_debug_libs_cb (void *data, const char *signal,
|
||||
(void) signal_data;
|
||||
|
||||
#ifdef USE_ENCHANT
|
||||
#ifdef HAVE_ENCHANT_GET_VERSION
|
||||
weechat_printf (NULL, " %s: enchant %s",
|
||||
ASPELL_PLUGIN_NAME, enchant_get_version ());
|
||||
#else
|
||||
weechat_printf (NULL, " %s: enchant (?)", ASPELL_PLUGIN_NAME);
|
||||
#endif /* HAVE_ENCHANT_GET_VERSION */
|
||||
#else
|
||||
#ifdef HAVE_ASPELL_VERSION_STRING
|
||||
weechat_printf (NULL, " %s: aspell %s",
|
||||
ASPELL_PLUGIN_NAME, aspell_version_string ());
|
||||
#else
|
||||
weechat_printf (NULL, " %s: aspell (?)", ASPELL_PLUGIN_NAME);
|
||||
#endif
|
||||
#endif /* HAVE_ASPELL_VERSION_STRING */
|
||||
#endif /* USE_ENCHANT */
|
||||
|
||||
return WEECHAT_RC_OK;
|
||||
|
Loading…
x
Reference in New Issue
Block a user