~ubuntu-branches/ubuntu/hoary/psi/hoary

« back to all changes in this revision

Viewing changes to qcm/zlib.qcm

  • Committer: Bazaar Package Importer
  • Author(s): Jan Niehusmann
  • Date: 2004-06-15 00:10:41 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20040615001041-enywb6pcpe4sjsw6
Tags: 0.9.2-1
* New upstream release
* Set KDEDIR for ./configure so kde specific files get installed
* Don't install libpsiwidgets.so. It got installed in /usr/share
  where it doesn't belong. May be included (at a better location)
  later.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
-----BEGIN QCMOD-----
 
3
name: zlib
 
4
arg: with-zlib-inc=[path],Path to zlib include files
 
5
arg: with-zlib-lib=[path],Path to zlib library files
 
6
-----END QCMOD-----
 
7
*/
 
8
 
 
9
//----------------------------------------------------------------------------
 
10
// qc_zlib
 
11
//----------------------------------------------------------------------------
 
12
class qc_zlib : public ConfObj
 
13
{
 
14
public:
 
15
        qc_zlib(Conf *c) : ConfObj(c) {}
 
16
        QString name() const { return "zlib"; }
 
17
        QString shortname() const { return "zlib"; }
 
18
        bool exec()
 
19
        {
 
20
                QString inc, lib;
 
21
                QString s;
 
22
 
 
23
                s = conf->getenv("QC_WITH_ZLIB_INC");
 
24
                if(!s.isEmpty()) {
 
25
                        if(!conf->checkHeader(s, "zlib.h"))
 
26
                                return false;
 
27
                        inc = s;
 
28
                }
 
29
                else {
 
30
                        if(!conf->findHeader("zlib.h", QStringList(), &s))
 
31
                                return false;
 
32
                        inc = s;
 
33
                }
 
34
 
 
35
                s = conf->getenv("QC_WITH_ZLIB_LIB");
 
36
                if(!s.isEmpty()) {
 
37
                        if(!conf->checkLibrary(s, "z"))
 
38
                                return false;
 
39
                        lib = s;
 
40
                }
 
41
                else {
 
42
                        if(!conf->findLibrary("z", &s))
 
43
                                return false;
 
44
                        lib = s;
 
45
                }
 
46
 
 
47
                if(!inc.isEmpty())
 
48
                        conf->addIncludePath(inc);
 
49
                if(!lib.isEmpty())
 
50
                        conf->addLib(QString("-L") + s);
 
51
                conf->addLib("-lz");
 
52
 
 
53
                return true;
 
54
        }
 
55
};