Fix runtime openssl library detection on multiarch

This closes Bug 809
(cherry picked from commit 09d01cacf8)
v3.5.13-sru
Timothy Pearson 13 years ago committed by Slávek Banko
parent 9a37f39d56
commit 67104c35e1

@ -28,7 +28,7 @@
#include <kconfig.h> #include <kconfig.h>
#include <kstaticdeleter.h> #include <kstaticdeleter.h>
#include <tqregexp.h> #include <tqregexp.h>
#include <tqdir.h>
#include <stdio.h> #include <stdio.h>
#include <unistd.h> #include <unistd.h>
@ -293,21 +293,21 @@ KConfig *cfg;
_cryptoLib = ll->globalLibrary(libname.latin1()); _cryptoLib = ll->globalLibrary(libname.latin1());
} }
#elif defined(__CYGWIN__) #elif defined(__CYGWIN__)
libpaths << "/usr/bin/" libpaths << "/usr/bin/"
<< "/usr/local/bin" << "/usr/local/bin"
<< "/usr/local/openssl/bin" << "/usr/local/openssl/bin"
<< "/opt/openssl/bin" << "/opt/openssl/bin"
<< "/opt/trinity/bin" << "/opt/trinity/bin"
<< ""; << "";
libnamess << "cygssl-0.9.7.dll" libnamess << "cygssl-0.9.7.dll"
<< "cygssl.dll" << "cygssl.dll"
<< "libssl.dll" << "libssl.dll"
<< ""; << "";
libnamesc << "cygcrypto.dll" libnamesc << "cygcrypto.dll"
<< "libcrypto.dll" << "libcrypto.dll"
<< ""; << "";
#else #else
libpaths libpaths
#ifdef _AIX #ifdef _AIX
@ -321,7 +321,7 @@ KConfig *cfg;
<< "/opt/openssl/lib" KDELIBSUFF "/" << "/opt/openssl/lib" KDELIBSUFF "/"
<< "/lib" KDELIBSUFF "/" << "/lib" KDELIBSUFF "/"
<< ""; << "";
// FIXME: #define here for the various OS types to optimize // FIXME: #define here for the various OS types to optimize
libnamess libnamess
#ifdef hpux #ifdef hpux
@ -372,6 +372,18 @@ KConfig *cfg;
tmpStr.replace(TQRegExp("\\(.*\\)"), ""); tmpStr.replace(TQRegExp("\\(.*\\)"), "");
if (!access(tmpStr.latin1(), R_OK)) if (!access(tmpStr.latin1(), R_OK))
_cryptoLib = ll->globalLibrary(alib.latin1()); _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;
} }
if (_cryptoLib) break; if (_cryptoLib) break;
@ -530,6 +542,18 @@ KConfig *cfg;
tmpStr.replace(TQRegExp("\\(.*\\)"), ""); tmpStr.replace(TQRegExp("\\(.*\\)"), "");
if (!access(tmpStr.latin1(), R_OK)) if (!access(tmpStr.latin1(), R_OK))
_sslLib = ll->globalLibrary(alib.latin1()); _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;
} }
if (_sslLib) break; if (_sslLib) break;

Loading…
Cancel
Save