diff --git a/src/Makefile.am b/src/Makefile.am index 53dca0f3..5da2a048 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -216,6 +216,8 @@ utils/copyfile.cpp \ utils/copyfile.h \ utils/cpuconf.cpp \ utils/cpuconf.h \ +utils/dlib.cpp \ +utils/dlib.h \ utils/ecrontab.cpp \ utils/ecrontab.h \ utils/execmd.cpp \ diff --git a/src/aspell/rclaspell.cpp b/src/aspell/rclaspell.cpp index 15efb1da..15a5a9b2 100644 --- a/src/aspell/rclaspell.cpp +++ b/src/aspell/rclaspell.cpp @@ -423,10 +423,14 @@ bool Aspell::make_speller(string& reason) aapi.aspell_config_replace(config, "encoding", "utf-8"); aapi.aspell_config_replace(config, "master", dicPath().c_str()); aapi.aspell_config_replace(config, "sug-mode", "fast"); +#ifdef _WIN32 aapi.aspell_config_replace(config, "data-dir", m_data->m_datadir.c_str()); - aapi.aspell_config_replace( - config, "local-data-dir", - m_data->m_addCreateParam.substr(ldatadiroptsz).c_str()); +#endif + if (m_data->m_addCreateParam.size() > ldatadiroptsz) { + aapi.aspell_config_replace( + config, "local-data-dir", + m_data->m_addCreateParam.substr(ldatadiroptsz).c_str()); + } // aapi.aspell_config_replace(config, "sug-edit-dist", "2"); ret = aapi.new_aspell_speller(config); aapi.delete_aspell_config(config); diff --git a/src/common/autoconfig.h.in b/src/common/autoconfig.h.in index 123e528b..c6dc665a 100644 --- a/src/common/autoconfig.h.in +++ b/src/common/autoconfig.h.in @@ -24,6 +24,9 @@ /* Define to 1 if you have the header file. */ #undef HAVE_DLFCN_H +/* dlopen function is available */ +#undef HAVE_DLOPEN + /* Define if you have the iconv() function and it works. */ #undef HAVE_ICONV @@ -36,9 +39,6 @@ /* Define to 1 if you have the `chm' library (-lchm). */ #undef HAVE_LIBCHM -/* Define to 1 if you have the `dl' library (-ldl). */ -#undef HAVE_LIBDL - /* Define to 1 if you have the `pthread' library (-lpthread). */ #undef HAVE_LIBPTHREAD diff --git a/src/configure.ac b/src/configure.ac index a3ec86dc..255a6d3c 100644 --- a/src/configure.ac +++ b/src/configure.ac @@ -267,7 +267,10 @@ AM_CONDITIONAL(MAKEPYTHONCHM, [test X$pythonChmEnabled = Xyes]) AC_CHECK_FUNCS(mkdtemp) AC_CHECK_LIB([pthread], [pthread_create], [], []) -AC_CHECK_LIB([dl], [dlopen], [], []) +AC_SEARCH_LIBS([dlopen], [dl], [], []) +if test X$ac_cv_search_function != Xno ; then + AC_DEFINE(HAVE_DLOPEN, 1, [dlopen function is available]) +fi AC_CHECK_LIB([z], [zlibVersion], [], []) ############# Putenv