summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--CMakeLists.txt12
-rw-r--r--config.h.cmake1
-rw-r--r--kdecore/ksocks.cpp8
-rw-r--r--kdeprint/cups/cupsdconf2/cupsdconf.cpp13
-rw-r--r--kdeui/ksconfig.cpp29
-rw-r--r--kio/kssl/kopenssl.cc41
-rw-r--r--kspell2/plugins/ispell/CMakeLists.txt1
-rw-r--r--kspell2/plugins/ispell/ispell_checker.cpp4
8 files changed, 56 insertions, 53 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 0dddcafe2..8763e250a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -124,6 +124,18 @@ if( ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" )
endif( ${CMAKE_SYSTEM_NAME} STREQUAL "Linux" )
+##### get the system's default path for libraries
+
+tde_save_and_set( CMAKE_INSTALL_PREFIX "/usr" )
+include( GNUInstallDirs OPTIONAL )
+if( CMAKE_INSTALL_LIBDIR )
+ set( SYSTEM_LIBDIR "${CMAKE_INSTALL_LIBDIR}" )
+else( )
+ set( SYSTEM_LIBDIR "lib${LIB_SUFFIX}" )
+endif( )
+tde_restore( CMAKE_INSTALL_PREFIX )
+
+
##### check for compiler capabilities ###########
include( CheckCXXCompilerFlag )
diff --git a/config.h.cmake b/config.h.cmake
index b2e5b7258..4aba3f528 100644
--- a/config.h.cmake
+++ b/config.h.cmake
@@ -775,6 +775,7 @@
/* Suffix for lib directories */
#define KDELIBSUFF "@KDELIBSUFF@"
+#define SYSTEM_LIBDIR "@SYSTEM_LIBDIR@"
/* The compiled in system configuration prefix */
#define KDESYSCONFDIR "@CONFIG_INSTALL_DIR@"
diff --git a/kdecore/ksocks.cpp b/kdecore/ksocks.cpp
index e596c50d9..0f05c17e3 100644
--- a/kdecore/ksocks.cpp
+++ b/kdecore/ksocks.cpp
@@ -254,13 +254,13 @@ KSocks::KSocks(KConfigBase *config) : _socksLib(0L), _st(0L) {
return;
_libPaths << ""
- << "/usr/lib" KDELIBSUFF "/"
+ << "/usr/" SYSTEM_LIBDIR "/"
<< "/usr/lib/"
- << "/usr/local/lib" KDELIBSUFF "/"
+ << "/usr/local/" SYSTEM_LIBDIR "/"
<< "/usr/local/lib/"
- << "/usr/local/socks5/lib" KDELIBSUFF "/"
+ << "/usr/local/socks5/" SYSTEM_LIBDIR "/"
<< "/usr/local/socks5/lib/"
- << "/opt/socks5/lib" KDELIBSUFF "/"
+ << "/opt/socks5/" SYSTEM_LIBDIR "/"
<< "/opt/socks5/lib/";
_libNames << "libsocks.so" // Dante
<< "libdsocksd.so.0" // Dante 1.1.14-2 on
diff --git a/kdeprint/cups/cupsdconf2/cupsdconf.cpp b/kdeprint/cups/cupsdconf2/cupsdconf.cpp
index 638d0645d..3b57c2e12 100644
--- a/kdeprint/cups/cupsdconf2/cupsdconf.cpp
+++ b/kdeprint/cups/cupsdconf2/cupsdconf.cpp
@@ -71,10 +71,15 @@ CupsdConf::CupsdConf()
//fontpath_ << (datadir_+"/fonts");
requestdir_ = findDir(TQStringList("/var/spool/cups")
<< "/var/cups");
- serverbin_ = findDir(TQStringList("/usr/lib" KDELIBSUFF "/cups")
- << "/usr/local/lib" KDELIBSUFF "/cups"
- << "/opt/lib" KDELIBSUFF "/cups"
- << "/opt/local/lib" KDELIBSUFF "/cups");
+ serverbin_ = findDir(TQStringList()
+ << "/usr/" SYSTEM_LIBDIR "/cups"
+ << "/usr/lib/cups"
+ << "/usr/local/" SYSTEM_LIBDIR "/cups"
+ << "/usr/local/lib/cups"
+ << "/opt/" SYSTEM_LIBDIR "/cups"
+ << "/opt/lib/cups"
+ << "/opt/local/" SYSTEM_LIBDIR "/cups"
+ << "/opt/local/lib/cups");
serverfiles_ = findDir(TQStringList("/etc/cups")
<< "/usr/local/etc/cups");
tmpfiles_ = requestdir_+"/tmp";
diff --git a/kdeui/ksconfig.cpp b/kdeui/ksconfig.cpp
index c82f71ef7..81c6e8417 100644
--- a/kdeui/ksconfig.cpp
+++ b/kdeui/ksconfig.cpp
@@ -444,20 +444,25 @@ void KSpellConfig::getAvailDictsIspell () {
dictcombo->insertItem( i18n("ISpell Default") );
// dictionary path
- TQFileInfo dir ("/usr/lib" KDELIBSUFF "/ispell");
- if (!dir.exists() || !dir.isDir())
- dir.setFile ("/usr/local/lib" KDELIBSUFF "/ispell");
- if (!dir.exists() || !dir.isDir())
- dir.setFile ("/usr/local/share/ispell");
- if (!dir.exists() || !dir.isDir())
- dir.setFile ("/usr/share/ispell");
- if (!dir.exists() || !dir.isDir())
- dir.setFile ("/usr/pkg/lib");
+ TQFileInfo dir;
+ TQStringList dirs;
+ dirs
+ << "/usr/" SYSTEM_LIBDIR "/ispell"
+ << "/usr/lib/ispell"
+ << "/usr/local/" SYSTEM_LIBDIR "/ispell"
+ << "/usr/local/lib/ispell"
+ << "/usr/local/share/ispell"
+ << "/usr/share/ispell"
+ << "/usr/pkg/lib";
+ for (TQStringList::ConstIterator it=dirs.begin(); it != dirs.end(); ++it) {
+ dir.setFile(*it);
+ if (dir.exists() && dir.isDir()) {
+ break;
+ }
+ }
/* TODO get them all instead of just one of them.
* If /usr/local/lib exists, it skips the rest
- if (!dir.exists() || !dir.isDir())
- dir.setFile ("/usr/local/lib");
- */
+ */
if (!dir.exists() || !dir.isDir()) return;
kdDebug(750) << "KSpellConfig::getAvailDictsIspell "
diff --git a/kio/kssl/kopenssl.cc b/kio/kssl/kopenssl.cc
index cd880540f..dc46281d0 100644
--- a/kio/kssl/kopenssl.cc
+++ b/kio/kssl/kopenssl.cc
@@ -28,7 +28,6 @@
#include <kconfig.h>
#include <kstaticdeleter.h>
#include <tqregexp.h>
-#include <tqdir.h>
#include <stdio.h>
#include <unistd.h>
@@ -324,7 +323,7 @@ KConfig *cfg;
#ifdef __OpenBSD__
{
- TQString libname = findMostRecentLib("/usr/lib" KDELIBSUFF, "crypto");
+ TQString libname = findMostRecentLib("/usr/" SYSTEM_LIBDIR, "crypto");
if (!libname.isNull())
_cryptoLib = ll->globalLibrary(libname.latin1());
}
@@ -349,13 +348,13 @@ KConfig *cfg;
#ifdef _AIX
<< "/opt/freeware/lib/"
#endif
- << "/usr/lib" KDELIBSUFF "/"
- << "/usr/ssl/lib" KDELIBSUFF "/"
- << "/usr/local/lib" KDELIBSUFF "/"
- << "/usr/local/openssl/lib" KDELIBSUFF "/"
- << "/usr/local/ssl/lib" KDELIBSUFF "/"
- << "/opt/openssl/lib" KDELIBSUFF "/"
- << "/lib" KDELIBSUFF "/"
+ << "/usr/" SYSTEM_LIBDIR "/"
+ << "/usr/ssl/" SYSTEM_LIBDIR "/"
+ << "/usr/local/" SYSTEM_LIBDIR "/"
+ << "/usr/local/openssl/" SYSTEM_LIBDIR "/"
+ << "/usr/local/ssl/" SYSTEM_LIBDIR "/"
+ << "/opt/openssl/" SYSTEM_LIBDIR "/"
+ << "/" SYSTEM_LIBDIR "/"
<< "";
// FIXME: #define here for the various OS types to optimize
@@ -408,18 +407,6 @@ KConfig *cfg;
tmpStr.replace(TQRegExp("\\(.*\\)"), "");
if (!access(tmpStr.latin1(), R_OK))
_cryptoLib = ll->globalLibrary(alib.latin1());
- if (!_cryptoLib) {
- // Multiarch triplet search
- TQDir madir (*it);
- TQStringList multiarchdirs = madir.entryList("*-*-*", TQDir::Dirs);
- for (TQStringList::Iterator mait = multiarchdirs.begin(); mait != multiarchdirs.end(); ++mait ) {
- TQString malib = *it + *mait + "/" + *shit;
- TQString tmpStr(malib.latin1());
- tmpStr.replace(TQRegExp("\\(.*\\)"), "");
- if (!access(tmpStr.latin1(), R_OK))
- _cryptoLib = ll->globalLibrary(malib.latin1());
- }
- }
if (_cryptoLib) break;
}
if (_cryptoLib) break;
@@ -611,18 +598,6 @@ KConfig *cfg;
tmpStr.replace(TQRegExp("\\(.*\\)"), "");
if (!access(tmpStr.latin1(), R_OK))
_sslLib = ll->globalLibrary(alib.latin1());
- if (!_sslLib) {
- // Multiarch triplet search
- TQDir madir (*it);
- TQStringList multiarchdirs = madir.entryList("*-*-*", TQDir::Dirs);
- for (TQStringList::Iterator mait = multiarchdirs.begin(); mait != multiarchdirs.end(); ++mait ) {
- TQString malib = *it + *mait + "/" + *shit;
- TQString tmpStr(malib.latin1());
- tmpStr.replace(TQRegExp("\\(.*\\)"), "");
- if (!access(tmpStr.latin1(), R_OK))
- _sslLib = ll->globalLibrary(malib.latin1());
- }
- }
if (_sslLib) break;
}
if (_sslLib) break;
diff --git a/kspell2/plugins/ispell/CMakeLists.txt b/kspell2/plugins/ispell/CMakeLists.txt
index 0cd7d74a0..d414ed21d 100644
--- a/kspell2/plugins/ispell/CMakeLists.txt
+++ b/kspell2/plugins/ispell/CMakeLists.txt
@@ -12,6 +12,7 @@
include_directories(
${TQT_INCLUDE_DIRS}
${CMAKE_CURRENT_BINARY_DIR}
+ ${CMAKE_BINARY_DIR}
${CMAKE_BINARY_DIR}/kdecore
${CMAKE_SOURCE_DIR}/kspell2
${CMAKE_SOURCE_DIR}/kdecore
diff --git a/kspell2/plugins/ispell/ispell_checker.cpp b/kspell2/plugins/ispell/ispell_checker.cpp
index fba7d3479..b95be5e6d 100644
--- a/kspell2/plugins/ispell/ispell_checker.cpp
+++ b/kspell2/plugins/ispell/ispell_checker.cpp
@@ -29,6 +29,8 @@
* do so, delete this exception statement from your version.
*/
+#include <config.h>
+
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -53,7 +55,9 @@ typedef struct str_ispell_map
} IspellMap;
static const char *ispell_dirs [] = {
+ "/usr/" SYSTEM_LIBDIR "/ispell",
"/usr/lib/ispell",
+ "/usr/local/" SYSTEM_LIBDIR "/ispell",
"/usr/local/lib/ispell",
"/usr/local/share/ispell",
"/usr/share/ispell",