This is an automated email from the ASF dual-hosted git repository.

jimjag pushed a commit to branch trunk
in repository https://gitbox.apache.org/repos/asf/openoffice.git

commit dc23248bfaf3c85a9760d71764653d94e72a0aa0
Author: Jim Jagielski <[email protected]>
AuthorDate: Wed Jul 29 11:44:32 2026 -0400

    Fix the lldb helper under Python 3 and use configure's interpreter
---
 main/configure.ac                                  | 11 +++++++++++
 main/filter/source/config/fragments/makefile.mk    |  6 ++++++
 main/l10ntools/scripts/makefile.mk                 |  6 ++++++
 main/l10ntools/scripts/xhtex                       |  8 ++++----
 main/l10ntools/scripts/xtxex                       |  8 ++++----
 main/set_soenv.in                                  |  1 +
 main/solenv/inc/lldb4aoo.py                        |  2 +-
 main/testtools/source/bridgetest/pyuno/makefile.mk |  6 ++++++
 8 files changed, 39 insertions(+), 9 deletions(-)

diff --git a/main/configure.ac b/main/configure.ac
index af7e75434d..417c2c2181 100644
--- a/main/configure.ac
+++ b/main/configure.ac
@@ -4103,6 +4103,11 @@ if test "$_os" = "Darwin" && test "$with_system_python" 
!= "no"; then
    _python_version=`$_python -c "import sys; print(sys.version);" | head -c 4`
    AC_MSG_RESULT([compiling against system python ($_python, version 
$_python_version)])
 
+   dnl Hand the interpreter we just validated to the build, so that the build
+   dnl steps that run Python scripts use it instead of whatever "python3"
+   dnl happens to be first on PATH.
+   PYTHON_BIN="$_python"
+
    _python_ver=`$_python -c "import sysconfig; 
print(sysconfig.get_config_var('VERSION'));"`
 
    dnl Locate the headers. Prefer the framework/SDK locations, but fall back
@@ -4139,6 +4144,11 @@ elif test -n "$with_system_python" -o -n 
"$with_system_libs" && \
    AC_MSG_RESULT([external])
    AM_PATH_PYTHON([3.11])
 
+   dnl Hand the interpreter AM_PATH_PYTHON just validated to the build, so that
+   dnl the build steps that run Python scripts use it instead of whatever
+   dnl "python3" happens to be first on PATH.
+   PYTHON_BIN="$PYTHON"
+
    python_include=`$PYTHON -c "import sysconfig; 
print(sysconfig.get_config_var('INCLUDEPY'));"`
    python_version=`$PYTHON -c "import sysconfig; 
print(sysconfig.get_config_var('VERSION'));"`
    # Python 3.8 and later distinguish building Python modules from linking to 
the
@@ -4174,6 +4184,7 @@ else
    dnl for the Python 2.x .tar.bz2 and no longer applies.
 fi
 AC_SUBST(SYSTEM_PYTHON)
+AC_SUBST(PYTHON_BIN)
 AC_SUBST(PYTHON_CFLAGS)
 AC_SUBST(PYTHON_LIBS)
 HOME=`echo $HOME | sed 's:\\\\:/:g'`
diff --git a/main/filter/source/config/fragments/makefile.mk 
b/main/filter/source/config/fragments/makefile.mk
index 8c879fb5c9..88493ed0cd 100644
--- a/main/filter/source/config/fragments/makefile.mk
+++ b/main/filter/source/config/fragments/makefile.mk
@@ -142,8 +142,14 @@ $(ALL_FLAGS) : $(INCLUDE_FRAGMENTS)
 .IF "$(SOLAR_JAVA)"==""
 #cmc, hack to workaround the java build requirement
 .IF "$(SYSTEM_PYTHON)" == "YES"
+# PYTHON_BIN is the interpreter configure located and checked against the
+# 3.11 floor; fall back to PATH only if the environment does not carry it.
+.IF "$(PYTHON_BIN)"==""
 MERGE:=python3 ../tools/merge/pyAltFCFGMerge
 .ELSE
+MERGE:=$(PYTHON_BIN) ../tools/merge/pyAltFCFGMerge
+.ENDIF
+.ELSE
 MERGE:=$(AUGMENT_LIBRARY_PATH) $(SOLARBINDIR)/python 
../tools/merge/pyAltFCFGMerge
 .ENDIF
 .ELSE
diff --git a/main/l10ntools/scripts/makefile.mk 
b/main/l10ntools/scripts/makefile.mk
index 93c6e84b34..edf02d220e 100644
--- a/main/l10ntools/scripts/makefile.mk
+++ b/main/l10ntools/scripts/makefile.mk
@@ -32,7 +32,13 @@ TARGET = l10ntools_dummy_pyc
 .IF "$(SYSTEM_PYTHON)"!="YES"
 PYTHON=$(AUGMENT_LIBRARY_PATH) $(WRAPCMD) $(SOLARBINDIR)/python
 .ELSE                   # "$(SYSTEM_PYTHON)"!="YES"
+# PYTHON_BIN is the interpreter configure located and checked against the
+# 3.11 floor; fall back to PATH only if the environment does not carry it.
+.IF "$(PYTHON_BIN)"==""
 PYTHON=$(AUGMENT_LIBRARY_PATH) $(WRAPCMD) python3
+.ELSE                   # "$(PYTHON_BIN)"==""
+PYTHON=$(AUGMENT_LIBRARY_PATH) $(WRAPCMD) $(PYTHON_BIN)
+.ENDIF                  # "$(PYTHON_BIN)"==""
 .ENDIF                  # "$(SYSTEM_PYTHON)"!="YES"
 
 PYFILES = $(BIN)$/const.py \
diff --git a/main/l10ntools/scripts/xhtex b/main/l10ntools/scripts/xhtex
index 1b7bace16e..aee9fa9db8 100755
--- a/main/l10ntools/scripts/xhtex
+++ b/main/l10ntools/scripts/xhtex
@@ -27,14 +27,14 @@ fi
 
 if [ ${GUI} = "WNT" ]; then
 if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx  ]; then
-    exec "${PYTHON:-python3}" $SOLARVERSION/$INPATH/bin/xhtex.py "$@"
+    exec "${PYTHON_BIN:-python3}" $SOLARVERSION/$INPATH/bin/xhtex.py "$@"
 else
-    exec "${PYTHON:-python3}" $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xhtex.py 
"$@"
+    exec "${PYTHON_BIN:-python3}" 
$SOLARVERSION/$INPATH/bin$UPDMINOREXT/xhtex.py "$@"
 fi
 else
 if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx  ]; then
-    exec "${PYTHON:-python3}" $SOLARVERSION/$INPATH/bin/xhtex.py "$@"
+    exec "${PYTHON_BIN:-python3}" $SOLARVERSION/$INPATH/bin/xhtex.py "$@"
 else
-    exec "${PYTHON:-python3}" $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xhtex.py 
"$@"
+    exec "${PYTHON_BIN:-python3}" 
$SOLARVERSION/$INPATH/bin$UPDMINOREXT/xhtex.py "$@"
 fi
 fi
diff --git a/main/l10ntools/scripts/xtxex b/main/l10ntools/scripts/xtxex
index 4dff588c25..706327ad32 100755
--- a/main/l10ntools/scripts/xtxex
+++ b/main/l10ntools/scripts/xtxex
@@ -27,15 +27,15 @@ fi
 
 if [ ${GUI} = "WNT" ]; then
 if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx  ]; then
-    exec "${PYTHON:-python3}" $SOLARVERSION/$INPATH/bin/xtxex.py "$@"
+    exec "${PYTHON_BIN:-python3}" $SOLARVERSION/$INPATH/bin/xtxex.py "$@"
 else
-    exec "${PYTHON:-python3}" $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xtxex.py 
"$@"
+    exec "${PYTHON_BIN:-python3}" 
$SOLARVERSION/$INPATH/bin$UPDMINOREXT/xtxex.py "$@"
 fi
 else
 if [ x${SOLARVER}x = xx -o x${UPDMINOREXT}x = xx  ]; then
-    exec "${PYTHON:-python3}" $SOLARVERSION/$INPATH/bin/xtxex.py "$@"
+    exec "${PYTHON_BIN:-python3}" $SOLARVERSION/$INPATH/bin/xtxex.py "$@"
 else
-    exec "${PYTHON:-python3}" $SOLARVERSION/$INPATH/bin$UPDMINOREXT/xtxex.py 
"$@"
+    exec "${PYTHON_BIN:-python3}" 
$SOLARVERSION/$INPATH/bin$UPDMINOREXT/xtxex.py "$@"
 fi
 fi
 
diff --git a/main/set_soenv.in b/main/set_soenv.in
index 0dd3b35c62..d0218747e2 100644
--- a/main/set_soenv.in
+++ b/main/set_soenv.in
@@ -1950,6 +1950,7 @@ ToFile( "SYSTEM_OPENSSL",    "@SYSTEM_OPENSSL@",   "e" );
 ToFile( "OPENSSL_CFLAGS",    "@OPENSSL_CFLAGS@",   "e" );
 ToFile( "OPENSSL_LIBS",      "@OPENSSL_LIBS@",     "e" );
 ToFile( "SYSTEM_PYTHON",     "@SYSTEM_PYTHON@",    "e" );
+ToFile( "PYTHON_BIN",        "@PYTHON_BIN@",       "e" );
 ToFile( "PYTHON_CFLAGS",     "@PYTHON_CFLAGS@",    "e" );
 ToFile( "PYTHON_LIBS",       "@PYTHON_LIBS@",      "e" );
 if ($SYSTEM_PYTHON eq "NO") {
diff --git a/main/solenv/inc/lldb4aoo.py b/main/solenv/inc/lldb4aoo.py
index 6cd5cac43a..63dafa7694 100644
--- a/main/solenv/inc/lldb4aoo.py
+++ b/main/solenv/inc/lldb4aoo.py
@@ -36,7 +36,7 @@ def __lldb_init_module( dbg, dict):
 
        # add info about specific helper methods
        # assume functions with docstrings are available for general consumption
-       helper_funcs = [v for (k,v) in globals().iteritems() if( not 
k.startswith('_') and callable(v) and v.__doc__)]
+       helper_funcs = [v for (k,v) in list(globals().items()) if( not 
k.startswith('_') and callable(v) and v.__doc__)]
        if helper_funcs:
                print( 'Available AOO-specific helper functions:')
                for hfunc in helper_funcs:
diff --git a/main/testtools/source/bridgetest/pyuno/makefile.mk 
b/main/testtools/source/bridgetest/pyuno/makefile.mk
index 0c74aace14..99950110d5 100644
--- a/main/testtools/source/bridgetest/pyuno/makefile.mk
+++ b/main/testtools/source/bridgetest/pyuno/makefile.mk
@@ -42,7 +42,13 @@ REGEXC=$(DLLDEST)$/regcomp$(EXECPOST)
 .IF "$(SYSTEM_PYTHON)"!="YES"
 PYTHON=$(AUGMENT_LIBRARY_PATH) $(WRAPCMD) $(SOLARBINDIR)/python
 .ELSE                   # "$(SYSTEM_PYTHON)"!="YES"
+# PYTHON_BIN is the interpreter configure located and checked against the
+# 3.11 floor; fall back to PATH only if the environment does not carry it.
+.IF "$(PYTHON_BIN)"==""
 PYTHON=$(AUGMENT_LIBRARY_PATH) $(WRAPCMD) python3
+.ELSE                   # "$(PYTHON_BIN)"==""
+PYTHON=$(AUGMENT_LIBRARY_PATH) $(WRAPCMD) $(PYTHON_BIN)
+.ENDIF                  # "$(PYTHON_BIN)"==""
 .ENDIF                  # "$(SYSTEM_PYTHON)"!="YES"
 .IF "$(GUI)"=="WNT"
 
PYTHONPATH:=$(SOLARLIBDIR)$/pyuno;$(PWD);$(SOLARLIBDIR);$(SOLARLIBDIR)$/python;$(SOLARLIBDIR)$/python$/lib-dynload

Reply via email to