From 889432c2f8b577b3b3cda6960f4d76b32012d971 Mon Sep 17 00:00:00 2001 From: Sergey Ilinykh Date: Sun, 6 Sep 2020 15:48:32 +0300 Subject: [PATCH] Allow enchant2 for qmake build --- configure | 57 ++++++++++++++++++++++--------------------- configure.exe | Bin 146236 -> 146377 bytes qcm/enchant.qcm | 63 ++++++++++++++++++++++++------------------------ 3 files changed, 61 insertions(+), 59 deletions(-) diff --git a/configure b/configure index 6a4b32728..c21e71d0e 100755 --- a/configure +++ b/configure @@ -1824,7 +1824,7 @@ 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; @@ -1832,42 +1832,43 @@ 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" /* diff --git a/configure.exe b/configure.exe index 7ed24f18ece78559871ae1fc8c5a1c348f80f42e..c9b276a17540220059d687ba30238ad90a115812 100644 GIT binary patch delta 422 zcmdnp6iFqZ{CoE=^U{a`^-usbJd3t6iBQFa`&-BK5j4IQ!fLu`!S6^QtFJB?Q zw4|W4gbOUszl70f`m2wO^3!j2GFneJ5@Zq+P)^ND$xPz{D*!73S?dL2fdInJ_>|PN zV!h;?)WjkUO>4MvBn6py$ygLjukT`%n$Gx%F?IU$E=FIL%rpg!=^MfrMLD6K(KVW$ z5XLAn{azTO`t*|5i~`dSbOXJy@HSBF!Zk+T=?$+LS*AO5GxAM8aE*}z96YsLT+?@S zGiq=vAzU(@r-xC}5#nqVhv#G_6)R}lDu8H&awLamB$lNr*eaA1m8M#AP0#0LlG&cy I!+3rj047m^qyPW_ delta 270 zcmX^4ony~8j)pCazc?5jxBuo~6cS{badA7p6yu!S?VH*e?HH#wNHOwHXX<2>pI%?b zs5HI0laXio(G*5i5Q}$ui6UdrbjG`k!qZLa8NE32QZm!HxHvhd`*$%)G6CrVC_NEK zPrp#l$jY9YmzdGCGcUPVLEBaVM59Vg7o5&0A`DZP akyw_hV5?A4RGK=yr<_r7J6kW~;dKC3O<6kt diff --git a/qcm/enchant.qcm b/qcm/enchant.qcm index af27fbd35..a2316dba9 100644 --- a/qcm/enchant.qcm +++ b/qcm/enchant.qcm @@ -5,7 +5,7 @@ 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; @@ -13,40 +13,41 @@ 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; + } };