1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
|
From 9be90a96c537b4a743774b0be9ffc8ca5c6498da Mon Sep 17 00:00:00 2001
From: Matt Jolly <kangie@gentoo.org>
Date: Tue, 2 Apr 2024 20:47:38 +1000
Subject: [PATCH] Use AX_COMPARE_VERSION macro for golang version checks
The previous approach fragile, required manual updates,
and results in unexpected outcomes when the user has updated
golang.
Reported-by: Denny Rivetti <denny.rivetti.me@gmail.com>
--- a/configure.ac
+++ b/configure.ac
@@ -80,23 +80,13 @@ AC_ARG_ENABLE(golang,
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 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*|1.20*|1.21*|1.22*|1.23*)
- 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.14.x"
- ;;
- esac
+ if test -n "$GO"; then
+ GOVERSIONOPTION=version
+ go_version=$($GO $GOVERSIONOPTION | sed -e 's/go version go//' | sed -e 's/ .*$//')
+ AX_COMPARE_VERSION([$go_version], [ge], ["1.14.0"],
+ [with_golang="yes"; GO=],
+ [with_golang="no";
+ AC_MSG_ERROR([Go version ($go_version) is lower than the minimum required version ($REQUIRED_GO_VERSION)])])
fi
fi
AM_CONDITIONAL([FVWM_BUILD_GOLANG], [test x"$with_golang" = xyes])
@@ -1514,4 +1504,4 @@ Fvwm3 Configuration:
Build man pages? $with_mandoc$problem_mandoc
Build html man pages? $with_htmldoc$problem_htmldoc
-"
\ No newline at end of file
+"
|