From cc6e3045fa4a91e9c9abf17f8165cf40ebb3e3ee Mon Sep 17 00:00:00 2001 From: Flammie A Pirinen Date: Wed, 12 Jun 2024 11:08:08 +0200 Subject: [PATCH] [Template merge] required gtgramtool version --- .gitignore | 5 +---- m4/giella-macros.m4 | 17 +++++++++++++++++ 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/.gitignore b/.gitignore index e35d079..1efa7f0 100644 --- a/.gitignore +++ b/.gitignore @@ -84,12 +84,9 @@ /test/run-morph-tester.sh /test/run-yaml-testcases.sh /src/fst/morphology/test/*-adjective.txt -/src/fst/morphology/test/all*.txt -/src/fst/morphology/test/analysed*.txt +/src/fst/morphology/test/*.txt /src/fst/morphology/test/filtered* /src/fst/morphology/test/generate-*-lemmas.sh -/src/fst/morphology/test/generated*.txt -/src/fst/morphology/test/missing_*.txt /src/fst/morphology/test/phonology/negative-*.txt /src/fst/morphology/test/phonology/hfst-twolc-error-messages.txt /src/fst/morphology/test/phonology/pair-*.txt diff --git a/m4/giella-macros.m4 b/m4/giella-macros.m4 index a1609d6..110b0ac 100644 --- a/m4/giella-macros.m4 +++ b/m4/giella-macros.m4 @@ -674,6 +674,23 @@ AS_IF([test "x$enable_grammarchecker" != "xno"], then: pipx install git+https://github.com/divvun/giellaltgramtools ])]), AC_MSG_RESULT(yes)) +_gtgramtool_min_version=0.7.0 +gtgramtool_too_old_message="gtgramtool needs to be updated. + If you installed it with pipx, run: + pipx upgrade GiellaLTGramTools" +AC_MSG_CHECKING([the version of gtgramtool]) +AS_IF([test "x${GTGRAMTOOL}" != xno], + [_gtgramtool_version=$( "${GTGRAMTOOL}" --version | sed -e 's/^.*version //')], + [_gtgramtool_version=0]) +AC_MSG_RESULT([$_gtgramtool_version]) +AS_IF([test "x$enable_grammarchecker" != "xno"], + AC_MSG_CHECKING([whether the gtgramtool version is at least $_gtgramtool_min_version]) + AX_COMPARE_VERSION([$_gtgramtool_version], [ge], [$_gtgramtool_min_version], + [gtgramtool_version_ok=yes], [gtgramtool_version_ok=no]) + AS_IF([test "x${gtgramtool_version_ok}" != xno], + [AC_MSG_RESULT([$gtgramtool_version_ok])], + [AC_MSG_ERROR([$gtgramtool_too_old_message])])) + # Enable all spellers - default is 'no' AC_ARG_ENABLE([spellers],