53 lines
1.2 KiB
Text
53 lines
1.2 KiB
Text
/*
|
|
-----BEGIN QCMOD-----
|
|
name: external QCA 2.0
|
|
-----END QCMOD-----
|
|
*/
|
|
|
|
//----------------------------------------------------------------------------
|
|
// qc_qca
|
|
//----------------------------------------------------------------------------
|
|
class qc_qca : public ConfObj
|
|
{
|
|
public:
|
|
qc_qca(Conf *c) : ConfObj(c) {}
|
|
QString name() const { return "QCA 2.0"; }
|
|
QString shortname() const { return "qca"; }
|
|
|
|
QString checkString() const {
|
|
if (QFile::exists("third-party/qca/qca") && conf->getenv("QC_DISABLE_bundled_qca").isEmpty())
|
|
return "";
|
|
else
|
|
return ConfObj::checkString();
|
|
}
|
|
|
|
bool exec()
|
|
{
|
|
// Check if we have a bundnled version
|
|
if (QFile::exists("third-party/qca/qca") && conf->getenv("QC_DISABLE_bundled_qca").isEmpty())
|
|
return true;
|
|
|
|
// test for "crypto" feature and check qca version number
|
|
|
|
QString proextra =
|
|
"CONFIG += qt crypto\n"
|
|
"QT -= gui\n";
|
|
|
|
QString str =
|
|
"#include <QtCrypto>\n"
|
|
"\n"
|
|
"int main()\n"
|
|
"{\n"
|
|
" unsigned long x = QCA_VERSION;\n"
|
|
" if(x >= 0x016363) return 0; else return 1;\n"
|
|
"}\n";
|
|
|
|
int ret;
|
|
if(!conf->doCompileAndLink(str, QStringList(), QString(), proextra, &ret))
|
|
return false;
|
|
if(ret != 0)
|
|
return false;
|
|
|
|
return true;
|
|
}
|
|
};
|