From c8863828a1f6f0badb255d245d73bcc094e76838 Mon Sep 17 00:00:00 2001
From: sheaf <sam.derbyshire@gmail.com>
Date: Thu, 13 Jul 2023 13:56:31 +0200
Subject: [PATCH] Configure: canonicalise PythonCmd on Windows

This change makes PythonCmd resolve to a canonical absolute path on
Windows, which prevents HLS getting confused (now that we have a
build-time dependency on python).

fixes #23652
---
 m4/find_python.m4 | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/m4/find_python.m4 b/m4/find_python.m4
index 7e53b5877ee6..784e099e9c1c 100644
--- a/m4/find_python.m4
+++ b/m4/find_python.m4
@@ -5,6 +5,11 @@
 AC_DEFUN([FIND_PYTHON],[
     dnl Prefer the mingw64 distribution on Windows due to #17483.
     AC_PATH_PROG([PYTHON], [python3], [], [/mingw64/bin $PATH])
-    PythonCmd="$PYTHON"
+    if test "$HostOS" = "mingw32"
+    then
+      PythonCmd=$(cygpath -m "$PYTHON")
+    else
+      PythonCmd="$PYTHON"
+    fi
     AC_SUBST([PythonCmd])
 ])
-- 
GitLab