64 lines
1.5 KiB
Text
64 lines
1.5 KiB
Text
/*
|
|
-----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;
|
|
}
|
|
};
|