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/zlib.qcm

56 lines
1.1 KiB
Text
Raw Normal View History

2025-12-25 01:37:49 +05:00
/*
-----BEGIN QCMOD-----
name: zlib
arg: with-zlib-inc=[path],Path to zlib include files
arg: with-zlib-lib=[path],Path to zlib library files
-----END QCMOD-----
*/
//----------------------------------------------------------------------------
// qc_zlib
//----------------------------------------------------------------------------
class qc_zlib : public ConfObj
{
public:
qc_zlib(Conf *c) : ConfObj(c) {}
QString name() const { return "zlib"; }
QString shortname() const { return "zlib"; }
bool exec()
{
QString inc, lib;
QString s;
s = conf->getenv("QC_WITH_ZLIB_INC");
if(!s.isEmpty()) {
if(!conf->checkHeader(s, "zlib.h"))
return false;
inc = s;
}
else {
if(!conf->findHeader("zlib.h", QStringList(), &s))
return false;
inc = s;
}
s = conf->getenv("QC_WITH_ZLIB_LIB");
if(!s.isEmpty()) {
if(!conf->checkLibrary(s, "z"))
return false;
lib = s;
}
else {
if(!conf->findLibrary("z", &s))
return false;
lib = s;
}
if(!inc.isEmpty())
conf->addIncludePath(inc);
if(!lib.isEmpty())
conf->addLib(QString("-L") + s);
conf->addLib("-lz");
return true;
}
};