From patchwork Mon Sep 11 16:51:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Javi Merino X-Patchwork-Id: 13379523 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.xenproject.org (lists.xenproject.org [192.237.175.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 4C62DEE7FF4 for ; Mon, 11 Sep 2023 16:52:48 +0000 (UTC) Received: from list by lists.xenproject.org with outflank-mailman.599656.935180 (Exim 4.92) (envelope-from ) id 1qfk9N-0006pZ-OT; Mon, 11 Sep 2023 16:52:37 +0000 X-Outflank-Mailman: Message body and most headers restored to incoming version Received: by outflank-mailman (output) from mailman id 599656.935180; Mon, 11 Sep 2023 16:52:37 +0000 Received: from localhost ([127.0.0.1] helo=lists.xenproject.org) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qfk9N-0006pN-Lf; Mon, 11 Sep 2023 16:52:37 +0000 Received: by outflank-mailman (input) for mailman id 599656; Mon, 11 Sep 2023 16:52:37 +0000 Received: from se1-gles-sth1-in.inumbo.com ([159.253.27.254] helo=se1-gles-sth1.inumbo.com) by lists.xenproject.org with esmtp (Exim 4.92) (envelope-from ) id 1qfk9M-0005g0-WE for xen-devel@lists.xenproject.org; Mon, 11 Sep 2023 16:52:37 +0000 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [2a00:1450:4864:20::32e]) by se1-gles-sth1.inumbo.com (Halon) with ESMTPS id 9c20fdec-50c3-11ee-8785-cb3800f73035; Mon, 11 Sep 2023 18:52:36 +0200 (CEST) Received: by mail-wm1-x32e.google.com with SMTP id 5b1f17b1804b1-40061928e5aso53549715e9.3 for ; Mon, 11 Sep 2023 09:52:36 -0700 (PDT) Received: from EMEAENG6DZjqCfH.citrite.net (default-46-102-197-194.interdsl.co.uk. [46.102.197.194]) by smtp.gmail.com with ESMTPSA id b13-20020a05600c11cd00b003fefcbe7fa8sm10578124wmi.28.2023.09.11.09.52.35 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Sep 2023 09:52:35 -0700 (PDT) X-BeenThere: xen-devel@lists.xenproject.org List-Id: Xen developer discussion List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Errors-To: xen-devel-bounces@lists.xenproject.org Precedence: list Sender: "Xen-devel" X-Inumbo-ID: 9c20fdec-50c3-11ee-8785-cb3800f73035 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cloud.com; s=cloud; t=1694451156; x=1695055956; darn=lists.xenproject.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=uWR3yQmcKWDwWpf/I8JOHNwbnGjcKvY7WPldaM6ij1o=; b=UnDFuBzVwIiL0zjptQVPXdQM75uq/gQ7nO34vRXYwU/AzYYCGvJxstL2dkE7X0hUlD UwbYYe6l9IbQkFG87v8PsNrq8+Dld4XRug3Q8y9UNVLJiYPT7IXBPn8WoRtc1ccQZZMO hS/1jgXyhRU2xs7nltCdCZi0I1HG3ZbX5TH3g= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1694451156; x=1695055956; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=uWR3yQmcKWDwWpf/I8JOHNwbnGjcKvY7WPldaM6ij1o=; b=B9YOwVBAkwCSSmAdWWiL9hVZnQ5sgnJaw8XtqP6Q0hA9NEnP+aoLNodP7At2VSp1yd GmRFF1K1Y3NfOxgdek64FpswSw2A+T0cQeCvOMie+afa1O9YMvGfRavtIpAKmaY3mSV/ lrqH9mkvqBhhzwoeIcmJ8xYtmfutlw5JnfI39Ha58ZsRWnebqzwftxML8Fm2AMD8/xno J/x8dSWGXLkKVtEAYgCrD01YgjlJgLPNc5YPrnBSNnLxxaQW4CcuXRQgwHMtV0tImIsN MP6mVoXk8ka0qvezQ7kmpFFVc18WhgBNvszTIX21Nl896tADMh4fNoFJ7hRQuimX6MRy SmBA== X-Gm-Message-State: AOJu0Yx/uLnuFwlcbEodpiHYxvbiraSNT+1RoRykb18b88oJrDV+m6t+ cxHkf30tQOQCkg0QVZXl5b+AC7EYSM0/iZ8JQ20= X-Google-Smtp-Source: AGHT+IGynlsdxSx0n9nKQMoLGfszC3U0usQq/40SvyrYxDrncH8NI7OwUIA4E8qeWqIKxlIdJ/SBJA== X-Received: by 2002:a1c:ed08:0:b0:3fe:2a98:a24c with SMTP id l8-20020a1ced08000000b003fe2a98a24cmr7875975wmh.26.1694451155696; Mon, 11 Sep 2023 09:52:35 -0700 (PDT) From: Javi Merino To: xen-devel@lists.xenproject.org Cc: =?utf-8?q?Marek_Marczykowski-G=C3=B3recki?= , Jan Beulich , George Dunlap , Andrew Cooper , Wei Liu , Anthony PERARD , Juergen Gross Subject: [XEN PATCH v2 3/5] tools: don't use distutils in configure nor Makefile Date: Mon, 11 Sep 2023 17:51:02 +0100 Message-ID: <7b3ecf211f60e0d6f7a4d146b62f9c28eff003f5.1694450145.git.javi.merino@cloud.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: References: MIME-Version: 1.0 From: Marek Marczykowski-Górecki Python distutils is deprecated and is going to be removed in Python 3.12. The distutils.sysconfig is available as sysconfig module in stdlib since Python 3.2, so use that directly. Signed-off-by: Marek Marczykowski-Górecki --- m4/python_devel.m4 | 28 ++++++++++++++-------------- tools/libs/stat/Makefile | 4 ++-- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/m4/python_devel.m4 b/m4/python_devel.m4 index bbf1e0354b..bb60857b03 100644 --- a/m4/python_devel.m4 +++ b/m4/python_devel.m4 @@ -5,21 +5,21 @@ ac_previous_libs=$LIBS AC_PATH_PROG([pyconfig], [$PYTHON-config], [no]) AS_IF([test x"$pyconfig" = x"no"], [ dnl For those that don't have python-config - CPPFLAGS="$CFLAGS `$PYTHON -c 'import distutils.sysconfig; \ - print("-I" + distutils.sysconfig.get_config_var("INCLUDEPY"))'`" - CPPFLAGS="$CPPFLAGS `$PYTHON -c 'import distutils.sysconfig; \ - print(distutils.sysconfig.get_config_var("CFLAGS"))'`" - LDFLAGS="$LDFLAGS `$PYTHON -c 'import distutils.sysconfig; \ - print("-L" + distutils.sysconfig.get_python_lib(plat_specific=1,\ + CPPFLAGS="$CFLAGS `$PYTHON -c 'import sysconfig; \ + print("-I" + sysconfig.get_config_var("INCLUDEPY"))'`" + CPPFLAGS="$CPPFLAGS `$PYTHON -c 'import sysconfig; \ + print(sysconfig.get_config_var("CFLAGS"))'`" + LDFLAGS="$LDFLAGS `$PYTHON -c 'import sysconfig; \ + print("-L" + sysconfig.get_python_lib(plat_specific=1,\ standard_lib=1) + "/config")'`" - LDFLAGS="$LDFLAGS `$PYTHON -c 'import distutils.sysconfig; \ - print(distutils.sysconfig.get_config_var("LINKFORSHARED"))'`" - LDFLAGS="$LDFLAGS `$PYTHON -c 'import distutils.sysconfig; \ - print(distutils.sysconfig.get_config_var("LDFLAGS"))'`" - LIBS="$LIBS `$PYTHON -c 'import distutils.sysconfig; \ - print(distutils.sysconfig.get_config_var("LIBS"))'`" - LIBS="$LIBS `$PYTHON -c 'import distutils.sysconfig; \ - print(distutils.sysconfig.get_config_var("SYSLIBS"))'`" + LDFLAGS="$LDFLAGS `$PYTHON -c 'import sysconfig; \ + print(sysconfig.get_config_var("LINKFORSHARED"))'`" + LDFLAGS="$LDFLAGS `$PYTHON -c 'import sysconfig; \ + print(sysconfig.get_config_var("LDFLAGS"))'`" + LIBS="$LIBS `$PYTHON -c 'import sysconfig; \ + print(sysconfig.get_config_var("LIBS"))'`" + LIBS="$LIBS `$PYTHON -c 'import sysconfig; \ + print(sysconfig.get_config_var("SYSLIBS"))'`" ], [ dnl If python-config is found use it CPPFLAGS="$CFLAGS `$PYTHON-config --cflags`" diff --git a/tools/libs/stat/Makefile b/tools/libs/stat/Makefile index ee5c42bf7b..a968eaff48 100644 --- a/tools/libs/stat/Makefile +++ b/tools/libs/stat/Makefile @@ -73,8 +73,8 @@ $(PYLIB): $(PYSRC) python-bindings: $(PYLIB) $(PYMOD) pythonlibdir = $(shell $(PYTHON) -c \ - 'import distutils.sysconfig as cfg; \ - print(cfg.get_python_lib(False, False, prefix="$(prefix)"))') + 'import sysconfig; \ + print(sysconfig.get_python_lib("platlib", vars={"platbase": "$(prefix)"}))') .PHONY: install-python-bindings install-python-bindings: $(PYLIB) $(PYMOD)