source: psi/trunk/qcm/zlib.qcm@ 20

Last change on this file since 20 was 2, checked in by dmik, 19 years ago

Imported original Psi 0.10 sources from Affinix

File size: 1.1 KB
Line 
1/*
2-----BEGIN QCMOD-----
3name: zlib
4arg: with-zlib-inc=[path],Path to zlib include files
5arg: with-zlib-lib=[path],Path to zlib library files
6-----END QCMOD-----
7*/
8
9//----------------------------------------------------------------------------
10// qc_zlib
11//----------------------------------------------------------------------------
12class qc_zlib : public ConfObj
13{
14public:
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};
Note: See TracBrowser for help on using the repository browser.