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

65 lines
1.5 KiB
Text
Raw Permalink Normal View History

2025-12-25 01:37:49 +05:00
/*
-----BEGIN QCMOD-----
name: ASPELL
arg: with-aspell-inc=[path],Path to Aspell include files
arg: with-aspell-lib=[path],Path to Aspell library files
-----END QCMOD-----
*/
//----------------------------------------------------------------------------
// qc_spell
//----------------------------------------------------------------------------
class qc_aspell : public ConfObj
{
public:
qc_aspell(Conf *c) : ConfObj(c) {}
QString name() const { return "Aspell support"; }
QString shortname() const { return "aspell"; }
bool exec()
{
QString s;
s = conf->getenv("QC_WITH_ASPELL_INC");
if(!s.isEmpty()) {
if(!conf->checkHeader(s, "aspell.h")) {
conf->debug("Aspell includes not found!");
return false;
}
conf->addIncludePath(s);
}
else {
QStringList sl;
sl += "/usr/include";
sl += "/usr/local/include";
sl += "/sw/include";
if(!conf->findHeader("aspell.h", sl, &s)) {
conf->debug("Aspell includes not found!");
return false;
}
conf->addIncludePath(s);
}
s = conf->getenv("QC_WITH_ASPELL_LIB");
if(!s.isEmpty()) {
if(!conf->checkLibrary(s, "aspell")) {
conf->debug("Aspell libraries not found!");
return false;
}
conf->addLib(QString("-L") + s);
}
else {
if(!conf->findLibrary("aspell", &s)) {
conf->debug("Aspell libraries not found!");
return false;
}
if (!s.isEmpty())
conf->addLib(QString("-L") + s);
}
// conf->addLib("-laspell");
// conf->addDefine("HAVE_ASPELL");
return true;
}
};