On Thu, Apr 23, 2020 at 1:51 AM Nick Rosbrook <rosbro...@gmail.com> wrote:

> By default, if the go compiler is found by the configure script, build
> the golang tools. If the compiler is not found, and
> --enable-golang_tools was not explicitly set, do not build to the golang
> tools.
>
> The new corresponding make variable is CONFIG_GOLANG_TOOLS. Remove
> CONFIG_GOLANG from tools/Rules.mk since the new variable is set by
> configure.
>
> Signed-off-by: Nick Rosbrook <rosbro...@ainfosec.com>
> ---
>  config/Tools.mk.in |   1 +
>  m4/golang.m4       |   4 ++
>  tools/Makefile     |   2 +-
>  tools/Rules.mk     |   2 -
>  tools/configure    | 138 +++++++++++++++++++++++++++++++++++++++++++++
>  tools/configure.ac |  12 ++++
>  6 files changed, 156 insertions(+), 3 deletions(-)
>  create mode 100644 m4/golang.m4
>
> diff --git a/config/Tools.mk.in b/config/Tools.mk.in
> index 189fda1596..2c219f5477 100644
> --- a/config/Tools.mk.in
> +++ b/config/Tools.mk.in
> @@ -55,6 +55,7 @@ CONFIG_QEMU_TRAD    := @qemu_traditional@
>  CONFIG_QEMU_XEN     := @qemu_xen@
>  CONFIG_QEMUU_EXTRA_ARGS:= @EXTRA_QEMUU_CONFIGURE_ARGS@
>  CONFIG_LIBNL        := @libnl@
> +CONFIG_GOLANG_TOOLS := @golang_tools@
>
>  CONFIG_SYSTEMD      := @systemd@
>  SYSTEMD_CFLAGS      := @SYSTEMD_CFLAGS@
> diff --git a/m4/golang.m4 b/m4/golang.m4
> new file mode 100644
> index 0000000000..0b4bd54ce0
> --- /dev/null
> +++ b/m4/golang.m4
> @@ -0,0 +1,4 @@
> +AC_DEFUN([AC_PROG_GO], [
> +    dnl Check for the go compiler
> +    AC_CHECK_TOOL([GO],[go],[no])
> +])
>

AFAICT this only checks for the existence of the binary.  Will the bindings
compile with all versions of go?  If not, should we try to check the
version here?

Thanks,
 -George

Reply via email to