From 86fc444d96a3320ebd48a606a9fbfa55aaec74d7 Mon Sep 17 00:00:00 2001 From: Zhang Wen Date: Tue, 24 Jun 2025 13:39:29 +0800 Subject: [PATCH] fix building with freethreaded python --- bootstrap.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/bootstrap.sh b/bootstrap.sh index 654801e21f34..b89749c327eb 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -20,6 +20,7 @@ LIBS="" PYTHON=python PYTHON_VERSION= PYTHON_ROOT= +PYTHON_INCLUDES= ICU_ROOT= # Handle case where builtin shell version of echo command doesn't @@ -288,6 +289,12 @@ if test "x$flag_no_python" = x; then PYTHON_ROOT=`$PYTHON -c "import sys; print(sys.prefix)"` echo $PYTHON_ROOT fi + + if test "x$PYTHON_INCLUDES" = x; then + $ECHO -n "Detecting Python include... " + PYTHON_INCLUDES=`$PYTHON -c "import sys; python_version = \"%d.%d\" % (sys.version_info[0], sys.version_info[1]); print (\"%s/include/python%s%s\" % (sys.prefix, python_version, '' if sys._is_gil_enabled() else 't'))"` + echo $PYTHON_INCLUDES + fi fi # Configure ICU @@ -361,7 +368,7 @@ if test "x$flag_no_python" = x; then import python ; if ! [ python.configured ] { - using python : $PYTHON_VERSION : "$PYTHON_ROOT" ; + using python : $PYTHON_VERSION : "$PYTHON_ROOT" : "$PYTHON_INCLUDES" ; } EOF fi