Skip to content

Commit

Permalink
configure.ac: fix golang binary check
Browse files Browse the repository at this point in the history
When checking the version of golang, test the major part of the string
(1.XX.yy), and fix up the error message to not mislead the minimum
version.

Fixes fvwmorg#202
  • Loading branch information
ThomasAdam authored and mikeandmore committed Nov 28, 2020
1 parent e053c08 commit 3fc7d8a
Showing 1 changed file with 6 additions and 5 deletions.
11 changes: 6 additions & 5 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -82,18 +82,19 @@ if test ! x"$with_golang" = xno; then
AC_CHECK_PROGS(GO, go)
if test -n "$GO" ; then
GOVERSIONOPTION=version
go_version=$($GO $GOVERSIONOPTION | sed -e 's/go version //')
AC_MSG_CHECKING([whether go version is >= 1.4.x])
case $go_version in
go1.[14]*)
go_version=$($GO $GOVERSIONOPTION | sed -e 's/go version go//' | \
sed -e 's/ .*$//')
AC_MSG_CHECKING([whether go version is >= 1.14.x ($go_version)])
case "$go_version" in
1.14*|1.15*|1.16*|1.17*|1.18*|1.19*)
AC_MSG_RESULT([yes - version is: $go_version])
with_golang="yes"
GO=
;;
*)
AC_MSG_RESULT([no - version is: $go_version])
with_golang="no"
problem_golang=": version of go ($go_version) <= 1.4.x"
problem_golang=": version of go ($go_version) <= 1.14.x"
;;
esac
fi
Expand Down

0 comments on commit 3fc7d8a

Please sign in to comment.