From Python 3.8 and onwards C extensions are no longer
linked to libpython so in order to embed python within
an application the --embed flag needs to be added to
python3-config --libs. A fall back is provided as the
command will error out on previous python versions.
References: https://bugs.python.org/issue36721
if test $? -ne 0; then
with_libpython="no"
fi
- LIBPYTHON_LIBS="`${PYTHON_CONFIG} --libs`"
+ LIBPYTHON_LIBS="`${PYTHON_CONFIG} --libs --embed`" || LIBPYTHON_LIBS="`${PYTHON_CONFIG} --libs`"
if test $? -ne 0; then
with_libpython="no"
fi