Skip to content

Commit

Permalink
Allow enchant2 for qmake build
Browse files Browse the repository at this point in the history
  • Loading branch information
Ri0n committed Sep 6, 2020
1 parent 9fa29f9 commit 889432c
Show file tree
Hide file tree
Showing 3 changed files with 61 additions and 59 deletions.
57 changes: 29 additions & 28 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -1824,50 +1824,51 @@ name: enchant
*/
#define QC_ENCHANT
bool qc_enchant_have = false;
bool qc_enchant_have = false;
QStringList qc_enchant_defs;
QStringList qc_enchant_incs;
QStringList qc_enchant_libs;
//----------------------------------------------------------------------------
// qc_enchant
//----------------------------------------------------------------------------
class qc_enchant : public ConfObj
{
class qc_enchant : public ConfObj {
public:
qc_enchant(Conf *c) : ConfObj(c) {}
QString name() const { return "enchant"; }
QString shortname() const { return "enchant"; }
qc_enchant(Conf *c) : ConfObj(c) { }
QString name() const { return "enchant"; }
QString shortname() const { return "enchant"; }
// no output
QString checkString() const { return QString(); }
// no output
QString checkString() const { return QString(); }
bool exec()
{
// on mac, always use built-in spell check
bool exec()
{
// on mac, always use built-in spell check
#ifdef Q_OS_MAC
return false;
return false;
#endif
qc_enchant_have = false;
qc_enchant_defs.clear();
qc_enchant_incs.clear();
qc_enchant_libs.clear();
qc_enchant_have = false;
qc_enchant_defs.clear();
qc_enchant_incs.clear();
qc_enchant_libs.clear();
QStringList incs;
QString version, libs, other;
if(!conf->findPkgConfig("enchant", VersionMin, "1.3.0", &version, &incs, &libs, &other))
return false;
if(conf->findPkgConfig("enchant", VersionMin, "2.0.0", &version, &incs, &libs, &other))
qc_enchant_defs += "HAVE_ENCHANT2";
QStringList incs;
QString version, libs, other;
if (!conf->findPkgConfig("enchant", VersionMin, "1.3.0", &version, &incs, &libs, &other))
if (conf->findPkgConfig("enchant-2", VersionMin, "2.0.0", &version, &incs, &libs, &other)) {
qc_enchant_defs += "HAVE_ENCHANT2";
} else {
return false;
}
qc_enchant_defs += "HAVE_ENCHANT";
qc_enchant_incs += incs;
qc_enchant_libs += libs;
qc_enchant_have = true;
qc_enchant_defs += "HAVE_ENCHANT";
qc_enchant_incs += incs;
qc_enchant_libs += libs;
qc_enchant_have = true;
return true;
}
return true;
}
};
#line 1 "hunspell.qcm"
/*
Expand Down
Binary file modified configure.exe
Binary file not shown.
63 changes: 32 additions & 31 deletions qcm/enchant.qcm
Original file line number Diff line number Diff line change
Expand Up @@ -5,48 +5,49 @@ name: enchant
*/

#define QC_ENCHANT
bool qc_enchant_have = false;
bool qc_enchant_have = false;
QStringList qc_enchant_defs;
QStringList qc_enchant_incs;
QStringList qc_enchant_libs;

//----------------------------------------------------------------------------
// qc_enchant
//----------------------------------------------------------------------------
class qc_enchant : public ConfObj
{
class qc_enchant : public ConfObj {
public:
qc_enchant(Conf *c) : ConfObj(c) {}
QString name() const { return "enchant"; }
QString shortname() const { return "enchant"; }
qc_enchant(Conf *c) : ConfObj(c) { }
QString name() const { return "enchant"; }
QString shortname() const { return "enchant"; }

// no output
QString checkString() const { return QString(); }
// no output
QString checkString() const { return QString(); }

bool exec()
{
// on mac, always use built-in spell check
bool exec()
{
// on mac, always use built-in spell check
#ifdef Q_OS_MAC
return false;
return false;
#endif

qc_enchant_have = false;
qc_enchant_defs.clear();
qc_enchant_incs.clear();
qc_enchant_libs.clear();

QStringList incs;
QString version, libs, other;
if(!conf->findPkgConfig("enchant", VersionMin, "1.3.0", &version, &incs, &libs, &other))
return false;
if(conf->findPkgConfig("enchant", VersionMin, "2.0.0", &version, &incs, &libs, &other))
qc_enchant_defs += "HAVE_ENCHANT2";

qc_enchant_defs += "HAVE_ENCHANT";
qc_enchant_incs += incs;
qc_enchant_libs += libs;
qc_enchant_have = true;

return true;
}
qc_enchant_have = false;
qc_enchant_defs.clear();
qc_enchant_incs.clear();
qc_enchant_libs.clear();

QStringList incs;
QString version, libs, other;
if (!conf->findPkgConfig("enchant", VersionMin, "1.3.0", &version, &incs, &libs, &other))
if (conf->findPkgConfig("enchant-2", VersionMin, "2.0.0", &version, &incs, &libs, &other)) {
qc_enchant_defs += "HAVE_ENCHANT2";
} else {
return false;
}

qc_enchant_defs += "HAVE_ENCHANT";
qc_enchant_incs += incs;
qc_enchant_libs += libs;
qc_enchant_have = true;

return true;
}
};

0 comments on commit 889432c

Please sign in to comment.