~ubuntu-branches/ubuntu/karmic/psi/karmic

« back to all changes in this revision

Viewing changes to qcm/cyrussasl.qcm

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2008-04-14 18:57:30 UTC
  • mfrom: (2.1.9 hardy)
  • Revision ID: james.westby@ubuntu.com-20080414185730-528re3zp0m2hdlhi
Tags: 0.11-8
* added CONFIG -= link_prl to .pro files and removed dependencies
  which are made unnecessary by this change
* Fix segfault when closing last chat tab with qt4.4
  (This is from upstream svn, rev. 1101) (Closes: Bug#476122)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
-----BEGIN QCMOD-----
 
3
name: Cyrus SASL2 (bundled QCA only)
 
4
arg: with-sasl-inc=[path],Path to Cyrus SASL2 include files (bundled QCA only)
 
5
arg: with-sasl-lib=[path],Path to Cyrus SASL2 library files (bundled QCA only)
 
6
-----END QCMOD-----
 
7
*/
 
8
class qc_cyrussasl : public ConfObj
 
9
{
 
10
public:
 
11
        qc_cyrussasl(Conf *c) : ConfObj(c) {}
 
12
        QString name() const { return "Cyrus SASL2"; }
 
13
        QString shortname() const { return "cyrussasl"; }
 
14
 
 
15
        QString checkString() const {
 
16
                if (!QFile::exists("third-party/qca/qca") || !conf->getenv("QC_DISABLE_bundled_qca").isEmpty())
 
17
                        return "";
 
18
                else
 
19
                        return ConfObj::checkString();
 
20
        }
 
21
 
 
22
        bool exec()
 
23
        {
 
24
                if (!QFile::exists("third-party/qca/qca") || !conf->getenv("QC_DISABLE_bundled_qca").isEmpty() || !QFile::exists("third-party/qca/qca-sasl"))
 
25
                        return false;
 
26
 
 
27
                QString inc, lib;
 
28
                QString s;
 
29
 
 
30
                s = conf->getenv("QC_WITH_SASL_INC");
 
31
                if(!s.isEmpty()) {
 
32
                        if(!conf->checkHeader(s, "sasl/sasl.h"))
 
33
                                return false;
 
34
                        inc = s;
 
35
                }
 
36
                else {
 
37
                        if(!conf->findHeader("sasl/sasl.h", QStringList(), &s))
 
38
                                return false;
 
39
                        inc = s;
 
40
                }
 
41
 
 
42
                s = conf->getenv("QC_WITH_SASL_LIB");
 
43
                if(!s.isEmpty()) {
 
44
                        if(!conf->checkLibrary(s, "sasl2"))
 
45
                                return false;
 
46
                        lib = s;
 
47
                }
 
48
                else {
 
49
                        if(!conf->findLibrary("sasl2", &s))
 
50
                                return false;
 
51
                        lib = s;
 
52
                }
 
53
 
 
54
                if(!inc.isEmpty())
 
55
                        conf->addIncludePath(inc);
 
56
                if(!lib.isEmpty())
 
57
                        conf->addLib(QString("-L") + s);
 
58
                conf->addLib("-lsasl2");
 
59
                conf->addDefine("HAVE_CYRUSSASL");
 
60
                return true;
 
61
        }
 
62
};