From nobody Tue Nov 11 06:58:46 2025 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org ARC-Seal: i=1; a=rsa-sha256; t=1568823335; cv=none; d=zoho.com; s=zohoarc; b=nLz8vlGvdQetrjLW7x5fE46N/6onokjw3dxfe0BCxpnniW4IWfb8KIWLJFOv7Z0DWKZ4YKmehgf7mL6eSfoL9nglGkpZyPWsnyFi5Du4rNG+Eow95fANWMny8FhmXeEtaNa1VZPUrcmBVZLUCl2ybFv+EnmoM9agff5tdmpOT/Q= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1568823335; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Sender:Subject:To:ARC-Authentication-Results; bh=uYvMZKHjPmmjf9iVTVj35ioKJZ26+OENz4BAxgpCXOU=; b=UrOuL2TVWvurdtzkeagcM0DgJXATMPyaOYJDQZlhc/WASzCmMb2acGmjn7azitVpVcBZIUsL9SwlIfbEsbynC2+gwzQxfwO9BUY+pAe8PjbNmbBTUhxcUvxH9nCFHKrKU9EYg9zH1uj9VSEnttO6tfIl6ok9AYWTodC2bstnfZA= ARC-Authentication-Results: i=1; mx.zoho.com; dkim=fail; spf=none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) smtp.mailfrom=xen-devel-bounces@lists.xenproject.org Return-Path: Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) by mx.zohomail.com with SMTPS id 15688233353661006.8857752665149; Wed, 18 Sep 2019 09:15:35 -0700 (PDT) Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iAcaw-0004BY-23; Wed, 18 Sep 2019 16:14:18 +0000 Received: from all-amaz-eas1.inumbo.com ([34.197.232.57] helo=us1-amaz-eas2.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.89) (envelope-from ) id 1iAcau-0004BC-Nl for xen-devel@lists.xenproject.org; Wed, 18 Sep 2019 16:14:16 +0000 Received: from esa3.hc3370-68.iphmx.com (unknown [216.71.145.155]) by us1-amaz-eas2.inumbo.com (Halon) with ESMTPS id 5a1fe7fe-da2f-11e9-963c-12813bfff9fa; Wed, 18 Sep 2019 16:14:12 +0000 (UTC) X-Inumbo-ID: 5a1fe7fe-da2f-11e9-963c-12813bfff9fa DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=citrix.com; s=securemail; t=1568823253; h=from:to:cc:subject:date:message-id:mime-version; bh=V2xEulYZR53SyAEl4/oduUhssb81FbTNQ1iN/Fe4JvY=; b=Rd48+Gnb0AhPYpqdR1OmnFdx3IDZndwgIv2vsLp0ru+zFUJVxN7CuzW3 kcOb26wAMfp7XiF/VKs/Yb5x27w+p2tlZysXaAkP7Fk/cDYo7BTy0WVu4 fX45D4s73jhCYDwnO/R4kLe33QJYRamPB0OfpUkiDocLNvOmOUlrGQf2k c=; Authentication-Results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none; spf=None smtp.pra=ian.jackson@eu.citrix.com; spf=Pass smtp.mailfrom=Ian.Jackson@citrix.com; spf=None smtp.helo=postmaster@mail.citrix.com Received-SPF: none (zoho.com: 192.237.175.120 is neither permitted nor denied by domain of lists.xenproject.org) client-ip=192.237.175.120; envelope-from=xen-devel-bounces@lists.xenproject.org; helo=lists.xenproject.org; Received-SPF: None (esa3.hc3370-68.iphmx.com: no sender authenticity information available from domain of ian.jackson@eu.citrix.com) identity=pra; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="Ian.Jackson@citrix.com"; x-sender="ian.jackson@eu.citrix.com"; x-conformance=sidf_compatible Received-SPF: Pass (esa3.hc3370-68.iphmx.com: domain of Ian.Jackson@citrix.com designates 162.221.158.21 as permitted sender) identity=mailfrom; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="Ian.Jackson@citrix.com"; x-sender="Ian.Jackson@citrix.com"; x-conformance=sidf_compatible; x-record-type="v=spf1"; x-record-text="v=spf1 ip4:209.167.231.154 ip4:178.63.86.133 ip4:195.66.111.40/30 ip4:85.115.9.32/28 ip4:199.102.83.4 ip4:192.28.146.160 ip4:192.28.146.107 ip4:216.52.6.88 ip4:216.52.6.188 ip4:162.221.158.21 ip4:162.221.156.83 ~all" Received-SPF: None (esa3.hc3370-68.iphmx.com: no sender authenticity information available from domain of postmaster@mail.citrix.com) identity=helo; client-ip=162.221.158.21; receiver=esa3.hc3370-68.iphmx.com; envelope-from="Ian.Jackson@citrix.com"; x-sender="postmaster@mail.citrix.com"; x-conformance=sidf_compatible IronPort-SDR: wxag333C8jjSBPa7+VxD56j2cSLCpg/EsYJXuy36WB5SLg5dKu6T86QfvW1PPPJDrK7stdLAuI NNtH2V9UcjIlXZQcWy/FZbVQyCOqIiVV1e/kUEFmMjMha2jPdihmkiVR58GPD0h1TZxwCvTQTv ZASfbdduEC+nCqXHkzLoD5HWVBv+uyP4RZjOQkXs5O/aXZpMvWeDKKswCI+1V1BT0EIUITokE6 NJy198fnjC58zflwvmJM2AdmdpAvTqHJui8eaDWFw7lzYXe8m+XdDSs+MCDURnqqupBoptelBo Grw= X-SBRS: 2.7 X-MesageID: 5739459 X-Ironport-Server: esa3.hc3370-68.iphmx.com X-Remote-IP: 162.221.158.21 X-Policy: $RELAYED X-IronPort-AV: E=Sophos;i="5.64,521,1559534400"; d="scan'208";a="5739459" From: Ian Jackson To: Date: Wed, 18 Sep 2019 17:14:06 +0100 Message-ID: <20190918161406.19208-1-ian.jackson@eu.citrix.com> X-Mailer: git-send-email 2.11.0 MIME-Version: 1.0 Subject: [Xen-devel] [PATCH] tools/configure: Allow specifying python to be found from path X-BeenThere: xen-devel@lists.xenproject.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Cc: Doug Goldstein , Ian Jackson , George Dunlap , Wei Liu Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Errors-To: xen-devel-bounces@lists.xenproject.org Sender: "Xen-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) ./configure takes a PYTHON=3D... argument. You can use this to specify the python interpreter. However, for no good reason, it expects an absolute path. Fix this. The new logic is: * if not set, default to `python' * if not absolute, look it up with type -p * split into directory and executable name The results in config/Tools.mk (which contains @PYTHON@ and @PYTHONPATH@) are identical for both ./configure ./configure PYTHON=3D/usr/bin/python so I assert this has no functional change except that now you can say ./configure PYTHON=3Dpython In particular you can now say ./configure PYTHON=3Dpython2 ./configure PYTHON=3Dpython3 The latter is useful if you want python3 (which should probably be the default, but does not work right now). The former is useful if you want python2 but your distro has foolishly made "python" refer to python3. CC: Doug Goldstein CC: Wei Liu CC: George Dunlap Signed-off-by: Ian Jackson Acked-by: Wei Liu --- tools/configure | 13 +++++++------ tools/configure.ac | 10 +++++----- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/tools/configure b/tools/configure index 1baacea9ac..f2c66dfce9 100755 --- a/tools/configure +++ b/tools/configure @@ -6925,16 +6925,17 @@ then as_fn_error $? "Unable to find bash, please install bash" "$LINENO" 5 fi;; esac +if test -z "$PYTHON"; then : + PYTHON=3D"python" +fi if echo "$PYTHON" | grep -q "^/"; then : =20 - PYTHONPATH=3D$PYTHON - PYTHON=3D`basename $PYTHONPATH` - -elif test -z "$PYTHON"; then : - PYTHON=3D"python" else - as_fn_error $? "PYTHON specified, but is not an absolute path" "$LINENO"= 5 + PYTHON=3D`type -p "$PYTHON"` fi +PYTHONPATH=3D$PYTHON +PYTHON=3D`basename $PYTHONPATH` + # Extract the first word of "$PYTHON", so it can be a program name with ar= gs. set dummy $PYTHON; ac_word=3D$2 { $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5 diff --git a/tools/configure.ac b/tools/configure.ac index 3fe04907a2..674bd5809d 100644 --- a/tools/configure.ac +++ b/tools/configure.ac @@ -337,11 +337,11 @@ case "$host_os" in freebsd*) ;; *) AX_PATH_PROG_OR_FAIL([BASH], [bash]);; esac -AS_IF([echo "$PYTHON" | grep -q "^/"], [ - PYTHONPATH=3D$PYTHON - PYTHON=3D`basename $PYTHONPATH` -],[test -z "$PYTHON"], [PYTHON=3D"python"], -[AC_MSG_ERROR([PYTHON specified, but is not an absolute path])]) +AS_IF([test -z "$PYTHON"], [PYTHON=3D"python"]) +AS_IF([echo "$PYTHON" | grep -q "^/"], [], [PYTHON=3D`type -p "$PYTHON"`]) +PYTHONPATH=3D$PYTHON +PYTHON=3D`basename $PYTHONPATH` + AX_PATH_PROG_OR_FAIL([PYTHONPATH], [$PYTHON]) AX_CHECK_PYTHON_VERSION([2], [6]) =20 --=20 2.11.0 _______________________________________________ Xen-devel mailing list Xen-devel@lists.xenproject.org https://lists.xenproject.org/mailman/listinfo/xen-devel