Skip to content

Commit 2e4caa6

Browse files
committed
configure.ac: don't require libpython*.so in manylinux cibuildwheel
manylinux intentionally omits libpython*.so libraries from its build containers to discourage/prevent wheels' native extension libraries from linking against the Python DSO. We don't do that (anymore), but the AX_PYTHON_DEVEL Autoconf macro expects to be able to find it and fails its final sanity check if it can't. Thankfully, more recent versions of the macro support an 'optional' flag that allows configure to proceed even if the check fails. So now we set that flag and just check that we have a value in $PYTHON_CPPFLAGS, which is all the SWIG_PYTHON macro cares about in the first place.
1 parent f6299f4 commit 2e4caa6

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

configure.ac

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -311,7 +311,11 @@ AC_SUBST([libsecp256k1_LIBS])
311311
#
312312
# Python facilities
313313
#
314-
AX_PYTHON_DEVEL([>= '2.7.0'])
314+
dnl We set the 'optional' flag here because manylinux cibuildwheel containers
315+
dnl don't include libpython*.so, and thus AX_PYTHON_DEVEL fails its final sanity
316+
dnl check. We actually don't link against libpython*.so anyway, so all we care
317+
dnl about is that we get a good value of $PYTHON_CPPFLAGS to pass to SWIG.
318+
AX_PYTHON_DEVEL([>= '2.7.0'], [true])
315319
AM_CONDITIONAL([HAVE_PYTHON], [test "$PYTHON" != ""])
316320

317321

@@ -333,10 +337,10 @@ AC_ARG_ENABLE(swig-python,
333337
[swig_python=$enableval], [swig_python=no])
334338
AM_CONDITIONAL([USE_SWIG_PYTHON], [test "x$swig_python" = "xyes"])
335339

336-
AM_CONDITIONAL([RUN_PYTHON_TESTS], [test "$PYTHON" != "" -a "x$pythonexists" = "xyes"])
340+
AM_CONDITIONAL([RUN_PYTHON_TESTS], [test -n "$PYTHON"])
337341

338342
if test "x$swig_python" = "xyes"; then
339-
if test "x$pythonexists" != "xyes"; then
343+
if test -z "$PYTHON_CPPFLAGS"; then
340344
AC_MSG_FAILURE([ERROR: No usable Python was found for swig-python])
341345
fi
342346
if test "x$elements_abi" = "xno"; then

0 commit comments

Comments
 (0)