Skip to content

Commit 9e7c24c

Browse files
igorpeshanskystratakisSelf-Perfection
authored
Cherry-pick more upstream fixes to support building against python 3.8 (#203)
* Add Python 3.8 compatibility 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 * Fix linking with Python 3.8 Since Python 3.8 --embed flag needs to be provided to python-config to embed python. Reference: https://bugs.python.org/issue36721 This was partially addressed in collectd#3170 but only fixed building and not linking with python. Co-authored-by: Charalampos Stratakis <[email protected]> Co-authored-by: Alexander Meshcheryakov <[email protected]>
1 parent ddd6333 commit 9e7c24c

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

configure.ac

+2-2
Original file line numberDiff line numberDiff line change
@@ -4713,11 +4713,11 @@ if test "$PYTHON3_CONFIG" != ""; then
47134713
if test $? -ne 0; then
47144714
with_libpython3="no"
47154715
fi
4716-
LIBPYTHON3_LDFLAGS="`${PYTHON3_CONFIG} --ldflags`"
4716+
LIBPYTHON3_LDFLAGS="`${PYTHON3_CONFIG} --ldflags --embed`" || LIBPYTHON3_LDFLAGS="`${PYTHON3_CONFIG} --ldflags`"
47174717
if test $? -ne 0; then
47184718
with_libpython3="no"
47194719
fi
4720-
LIBPYTHON3_LIBS="`${PYTHON3_CONFIG} --libs`"
4720+
LIBPYTHON3_LIBS="`${PYTHON3_CONFIG} --libs --embed`" || LIBPYTHON3_LIBS="`${PYTHON3_CONFIG} --libs`"
47214721
if test $? -ne 0; then
47224722
with_libpython3="no"
47234723
fi

0 commit comments

Comments
 (0)