This repository has been archived on 2025-12-24. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
yachat/qcm/cyrussasl.qcm

63 lines
1.4 KiB
Text
Raw Permalink Normal View History

2025-12-25 01:37:49 +05:00
/*
-----BEGIN QCMOD-----
name: Cyrus SASL2 (bundled QCA only)
arg: with-sasl-inc=[path],Path to Cyrus SASL2 include files (bundled QCA only)
arg: with-sasl-lib=[path],Path to Cyrus SASL2 library files (bundled QCA only)
-----END QCMOD-----
*/
class qc_cyrussasl : public ConfObj
{
public:
qc_cyrussasl(Conf *c) : ConfObj(c) {}
QString name() const { return "Cyrus SASL2"; }
QString shortname() const { return "cyrussasl"; }
QString checkString() const {
if (!QFile::exists("third-party/qca/qca") || !conf->getenv("QC_DISABLE_bundled_qca").isEmpty())
return "";
else
return ConfObj::checkString();
}
bool exec()
{
if (!QFile::exists("third-party/qca/qca") || !conf->getenv("QC_DISABLE_bundled_qca").isEmpty() || !QFile::exists("third-party/qca/qca-sasl"))
return false;
QString inc, lib;
QString s;
s = conf->getenv("QC_WITH_SASL_INC");
if(!s.isEmpty()) {
if(!conf->checkHeader(s, "sasl/sasl.h"))
return false;
inc = s;
}
else {
if(!conf->findHeader("sasl/sasl.h", QStringList(), &s))
return false;
inc = s;
}
s = conf->getenv("QC_WITH_SASL_LIB");
if(!s.isEmpty()) {
if(!conf->checkLibrary(s, "sasl2"))
return false;
lib = s;
}
else {
if(!conf->findLibrary("sasl2", &s))
return false;
lib = s;
}
if(!inc.isEmpty())
conf->addIncludePath(inc);
if(!lib.isEmpty())
conf->addLib(QString("-L") + s);
conf->addLib("-lsasl2");
conf->addDefine("HAVE_CYRUSSASL");
return true;
}
};