From nobody Sat May 4 00:49:49 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail(p=none dis=none) header.from=gmail.com ARC-Seal: i=1; a=rsa-sha256; t=1591972297; cv=none; d=zohomail.com; s=zohoarc; b=FoMrHFPcYzQZLNZ6Ui5MpE0bKdrao6NaoowbiXPJoVfVf9OsLjxo9bIGG1D+CpO896+Z2GVe6vW+pNJxVjhJWEOn2yQt4ZYFbgapSzGSoIR4wysCVTMzeCAfhkCsuhvtMhTFA5wnHtTYaoxqjbbXUO0JKTYhwBiKCKLSy34hkhk= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1591972297; h=Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:Message-ID:Sender:Subject:To; bh=Hg+W0zABmF6n2uWPQyG+mVbjLgEVs3exLfQq39XfqCc=; b=oEjiqCmXLD9hN4tdRVXxXcXoW4nhUqXZPQtEAHw8sgih7UQZrrEmHYHYFYchL789J3MPHCSmiuZxCxjaF9aPfe6T+VQun9mawyS7CTuQvs6Kd05l0u6WKSzN53M7wK1CY89OzP9mgX5NpdgTeoI8NT0mkJtMFkBRztjo/SIZVcM= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of lists.xenproject.org designates 192.237.175.120 as permitted sender) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 1591972297423724.8303372546656; Fri, 12 Jun 2020 07:31:37 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jjki7-0007Nj-1u; Fri, 12 Jun 2020 14:31:11 +0000 Received: from us1-rack-iad1.inumbo.com ([172.99.69.81]) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1jjki5-0007Ne-DO for xen-devel@lists.xenproject.org; Fri, 12 Jun 2020 14:31:09 +0000 Received: from mail-qv1-xf2f.google.com (unknown [2607:f8b0:4864:20::f2f]) by us1-rack-iad1.inumbo.com (Halon) with ESMTPS id 5b38281a-acb9-11ea-8496-bc764e2007e4; Fri, 12 Jun 2020 14:31:08 +0000 (UTC) Received: by mail-qv1-xf2f.google.com with SMTP id dp10so4411323qvb.10 for ; Fri, 12 Jun 2020 07:31:08 -0700 (PDT) Received: from six.lan (cpe-67-241-56-252.twcny.res.rr.com. [67.241.56.252]) by smtp.gmail.com with ESMTPSA id h77sm4738729qke.37.2020.06.12.07.31.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 12 Jun 2020 07:31:06 -0700 (PDT) X-Inumbo-ID: 5b38281a-acb9-11ea-8496-bc764e2007e4 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=Hg+W0zABmF6n2uWPQyG+mVbjLgEVs3exLfQq39XfqCc=; b=aVU1EtfbcL/PrI273a78owxE7T+MlqcWBgaY2TuZ2QDlBKrU9zGG1+Kegg+R+MQwaY J3Ef7OEndUj+pLmQ7GR4LrOZcbn/s8sOvgpja1qYmMvCBXSR7y4opUIephUSsgrc7IRK JMY0GlJd4fZrz8fjpt5TH6s+r1qSer022DIgJy0fAbnTFxiSFYU0lI3u5MSuRZV6m1f3 b2M370ntLdUECVC+ZDCi0ctNdmv0UqB/Ap5dVocQNaJy8iJPkQAW6StG1NjLhtYhNDnj J1t3Bm6IO+mrDyvd77pOipF5kHfOKyON4rbEsBcKENaS6DFuWYEFGxk/v0f4YM5VBGgo PBaA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=Hg+W0zABmF6n2uWPQyG+mVbjLgEVs3exLfQq39XfqCc=; b=O1mOs7SkMCGseEF4pw7sP0Z5fySoH4PLI8e1NsQDOwZdx44+InDtej9kkVfko4iXQT pzBwzW8fUQScMcWOUcAx2RBIGVcbxbwlb+mJ+GthjpJSGAyhltA7fRNV8EhEBdG1grfU 2o3UVsC5h2aJzn45q2TatiUMnPVtyQL4NsWUkSXMt9wMJzfYFgH6HbuRgFbpV1lcRCWK PVLdHTugxGHBEWPPhVFobUcHuEuFDVuKFKiqWm2BI6ZcPKZpH8wW3yoL+L+/C1GfcLXy RrZBhpQ/QQOtNLDfa4SN0SHd+xFGB95Fh6spS9LtxXxfWZONrzjnhPoImgUeCKG0zOSX D7xg== X-Gm-Message-State: AOAM531MQkkveR5n0IumPc5tO/2hH3kDV6MMzDCt5FIL9oKfstF2DjJV KkLexFsggT9RQTD4LfZQRcLba+jUIx8= X-Google-Smtp-Source: ABdhPJyLqsqqxD8piMwE043nxlG7ig/iNnvJP8Th+Odt2Lc/2o0zN95bWz7gJ39xLuUBNUTvrHXoMQ== X-Received: by 2002:a0c:f84c:: with SMTP id g12mr12736822qvo.31.1591972267782; Fri, 12 Jun 2020 07:31:07 -0700 (PDT) From: Nick Rosbrook X-Google-Original-From: Nick Rosbrook To: xen-devel@lists.xenproject.org Subject: [PATCH for-4.14] tools: check go compiler version if present Date: Fri, 12 Jun 2020 10:31:02 -0400 Message-Id: X-Mailer: git-send-email 2.17.1 X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Nick Rosbrook , Ian Jackson , george.dunlap@citrix.com, Wei Liu , paul@xen.org Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Currently, no minimum go compiler version is required by the configure scripts. However, the go bindings actually will not build with some older versions of go. Add a check for a minimum go version of 1.11.1 in accordance with tools/golang/xenlight/go.mod. Signed-off-by: Nick Rosbrook Acked-by: George Dunlap Acked-by: Ian Jackson --- m4/golang.m4 | 4 ++++ tools/configure | 49 ++++++++++++++++++++++++++++++++++++++++++++++ tools/configure.ac | 7 +++++++ 3 files changed, 60 insertions(+) diff --git a/m4/golang.m4 b/m4/golang.m4 index 0b4bd54ce0..9cfd7e00a5 100644 --- a/m4/golang.m4 +++ b/m4/golang.m4 @@ -1,4 +1,8 @@ AC_DEFUN([AC_PROG_GO], [ dnl Check for the go compiler AC_CHECK_TOOL([GO],[go],[no]) + + if test "$GO" !=3D "no"; then + GOVERSION=3D`$GO version | cut -d " " -f 3 | sed "s/go//"` + fi ]) diff --git a/tools/configure b/tools/configure index b3668ec98d..f3f19c1a90 100755 --- a/tools/configure +++ b/tools/configure @@ -6845,6 +6845,10 @@ else fi =20 =20 + if test "$GO" !=3D "no"; then + GOVERSION=3D`$GO version | cut -d " " -f 3 | sed "s/go//"` + fi + if test "x$GO" =3D "xno"; then : =20 if test "x$enable_golang" =3D "xyes"; then : @@ -6854,6 +6858,51 @@ fi fi golang=3D"n" =20 +else + + + + + # Used to indicate true or false condition + ax_compare_version=3Dfalse + + # Convert the two version strings to be compared into a format that + # allows a simple string comparison. The end result is that a version + # string of the form 1.12.5-r617 will be converted to the form + # 0001001200050617. In other words, each number is zero padded to four + # digits, and non digits are removed. + + ax_compare_version_A=3D`echo "$GOVERSION" | sed -e 's/\([0-9]*\)/Z\1Z/g'= \ + -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/[^0-9]//g'` + + + ax_compare_version_B=3D`echo "1.11.1" | sed -e 's/\([0-9]*\)/Z\1Z/g' \ + -e 's/Z\([0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/Z\([0-9][0-9][0-9]\)Z/Z0\1Z/g' \ + -e 's/[^0-9]//g'` + + + ax_compare_version=3D`echo "x$ax_compare_version_A +x$ax_compare_version_B" | sed 's/^ *//' | sort -r | sed "s/x${ax_compare_v= ersion_A}/false/;s/x${ax_compare_version_B}/true/;1q"` + + + + if test "$ax_compare_version" =3D "true" ; then + + if test "x$enable_golang" =3D "xyes"; then : + + as_fn_error $? "\"Your version of go: $GOVERSION is not su= pported\"" "$LINENO" 5 + +fi + golang=3D"n" + + fi + + fi =20 fi diff --git a/tools/configure.ac b/tools/configure.ac index a9af0a21c6..9d126b7a14 100644 --- a/tools/configure.ac +++ b/tools/configure.ac @@ -338,6 +338,13 @@ AS_IF([test "x$golang" =3D "xy"], [ AC_MSG_ERROR([Go tools enabled, but missing go compiler]) ]) golang=3D"n" + ], [ + AX_COMPARE_VERSION([$GOVERSION], [lt], [1.11.1], [ + AS_IF([test "x$enable_golang" =3D "xyes"], [ + AC_MSG_ERROR(["Your version of go: $GOVERSION is not suppo= rted"]) + ]) + golang=3D"n" + ]) ]) ]) =20 --=20 2.17.1