summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt18
-rw-r--r--config.h.cmake3
-rw-r--r--tdespell2/plugins/ispell/ispell_checker.cpp4
-rw-r--r--tdeui/ksconfig.cpp4
4 files changed, 29 insertions, 0 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 1b673e2ff..78c595b18 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1125,6 +1125,24 @@ if( WITH_GAMIN )
endif( WITH_GAMIN )
+##### check for ispell ##########################
+
+if ( NOT ISPELL_LIBDIR )
+ find_program( ISPELL_EXECUTABLE NAMES ispell DOC "path to the ispell executable" )
+ if( ISPELL_EXECUTABLE )
+ execute_process (
+ COMMAND ${ISPELL_EXECUTABLE} -vv
+ COMMAND awk "$1 == \"LIBDIR\" && $2 == \"=\" {gsub(/\"/, \"\", $3); print $3;}"
+ OUTPUT_VARIABLE ISPELL_LIBDIR
+ OUTPUT_STRIP_TRAILING_WHITESPACE)
+ if ( ISPELL_LIBDIR )
+ set ( ISPELL_LIBDIR "${ISPELL_LIBDIR}" CACHE PATH "ispell lib directory contains dictionaries" )
+ else ( ISPELL_LIBDIR )
+ unset ( ISPELL_LIBDIR )
+ endif ( ISPELL_LIBDIR )
+ endif( ISPELL_EXECUTABLE )
+endif ( NOT ISPELL_LIBDIR )
+
##### check for aspell ##########################
# we need ASPELL_DATADIR too
diff --git a/config.h.cmake b/config.h.cmake
index 5916a07e0..b7a8120aa 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -1,5 +1,8 @@
/* config.h.in. Generated from configure.in by autoheader. */
+/* Define where ispell libdir is */
+#cmakedefine ISPELL_LIBDIR "@ISPELL_LIBDIR@"
+
/* Define where aspell data dir is */
#define ASPELL_DATADIR "@ASPELL_DATADIR@"
diff --git a/tdespell2/plugins/ispell/ispell_checker.cpp b/tdespell2/plugins/ispell/ispell_checker.cpp
index d21b8374b..d3dd324d3 100644
--- a/tdespell2/plugins/ispell/ispell_checker.cpp
+++ b/tdespell2/plugins/ispell/ispell_checker.cpp
@@ -54,6 +54,9 @@ typedef struct str_ispell_map
} IspellMap;
static const char *ispell_dirs [] = {
+#ifdef ISPELL_LIBDIR
+ ISPELL_LIBDIR,
+#else
"/usr/" SYSTEM_LIBDIR "/ispell",
"/usr/lib/ispell",
"/usr/local/" SYSTEM_LIBDIR "/ispell",
@@ -61,6 +64,7 @@ static const char *ispell_dirs [] = {
"/usr/local/share/ispell",
"/usr/share/ispell",
"/usr/pkg/lib",
+#endif
0
};
static const IspellMap ispell_map [] = {
diff --git a/tdeui/ksconfig.cpp b/tdeui/ksconfig.cpp
index 6ae9e3d5f..c814fec5c 100644
--- a/tdeui/ksconfig.cpp
+++ b/tdeui/ksconfig.cpp
@@ -603,6 +603,9 @@ KSpellConfig::fillDicts( TQComboBox* box, TQStringList* dictionaries )
box->insertItem( i18n("ISpell Default") );
// dictionary path
+#ifdef ISPELL_LIBDIR
+ TQFileInfo dir (ISPELL_LIBDIR);
+#else
TQFileInfo dir ("/usr/lib/ispell");
if (!dir.exists() || !dir.isDir())
dir.setFile ("/usr/local/lib/ispell");
@@ -617,6 +620,7 @@ KSpellConfig::fillDicts( TQComboBox* box, TQStringList* dictionaries )
if (!dir.exists() || !dir.isDir())
dir.setFile ("/usr/local/lib");
*/
+#endif
if (!dir.exists() || !dir.isDir()) return;
kdDebug(750) << "KSpellConfig::getAvailDictsIspell "