Skip to content

Commit de863df

Browse files
authored
Merge pull request #4209 from BsAtHome/fix_libboost_python-versioning
build: Select the libboost_python matching the python version.
2 parents c6c009e + 6246b2a commit de863df

1 file changed

Lines changed: 14 additions & 1 deletion

File tree

src/m4/ax_boost_python.m4

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,20 @@ BOOST_PYTHON_MODULE(test) { throw "Boost::Python test."; }]], [])],
9393
])
9494
if test "$ac_cv_boost_python" = "yes"; then
9595
AC_DEFINE(HAVE_BOOST_PYTHON,,[define if the Boost::Python library is available])
96-
ax_python_lib=boost_python
96+
# Debian sid after trixie installs both libboost_python313 and
97+
# libboost_python314 but it ships with Python 3.14. The detection loop fails
98+
# to select to correct version and that results in a crash.
99+
if test "x$ac_python_version" != "x"; then
100+
# This is set in m4/ax_python_devel.m4
101+
python_version=`echo $ac_python_version | tr -d .`
102+
else
103+
# Get the version from the binary and use it.
104+
python_version=`$PYTHON_BIN -c 'import sys; print("{}{}".format(sys.version_info.major,sys.version_info.minor))'`
105+
fi
106+
# We use the original versionless test first and append a versioned one with
107+
# the detected Python version to force the version matched library to be
108+
# tested before any file-system located libraries.
109+
ax_python_lib="boost_python boost_python$python_version"
97110
AC_ARG_WITH([boost-python],AS_HELP_STRING([--with-boost-python],[specify yes/no or the boost python library or suffix to use]),
98111
[if test "x$with_boost_python" != "xno" -a "x$with_boost_python" != "xyes"; then
99112
ax_python_lib=$with_boost_python

0 commit comments

Comments
 (0)