configure: Fix test for python 3.8

https://docs.python.org/3.8/whatsnew/3.8.html#debug-build-uses-the-same-abi-as-release-build

> To embed Python into an application, a new --embed option must be
> passed to python3-config --libs --embed to get -lpython3.8 (link the
> application to libpython). To support both 3.8 and older, try
> python3-config --libs --embed first and fallback to python3-config
> --libs (without --embed) if the previous command fails.

Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Acked-by: Wei Liu <wl@xen.org>
[ wei: rerun autogen.sh ]
This commit is contained in:
Anthony PERARD authored and Wei Liu committed 2019-11-20 10:46:48 +00:00
1 parent bad237ded7
commit 0d2791b007
2 files changed
+16 -4

No files matched your search

+9 -2
View File
@@ -23,8 +23,15 @@ AS_IF([test x"$pyconfig" = x"no"], [
], [
dnl If python-config is found use it
CPPFLAGS="$CFLAGS `$PYTHON-config --cflags`"
LDFLAGS="$LDFLAGS `$PYTHON-config --ldflags`"
LIBS="$LIBS `$PYTHON-config --libs`"
dnl We need to use --embed with python 3.8 but not with earlier version so
dnl check if it is recognized.
python_devel_embed=""
if $PYTHON-config --embed >/dev/null 2>/dev/null; then
python_devel_embed="--embed"
fi
LDFLAGS="$LDFLAGS `$PYTHON-config --ldflags $python_devel_embed`"
LIBS="$LIBS `$PYTHON-config --libs $python_devel_embed`"
unset python_devel_embed
])
AC_CHECK_HEADER([Python.h], [],
+7 -2
View File
@@ -7460,8 +7460,13 @@ if test x"$pyconfig" = x"no"; then :
else
CPPFLAGS="$CFLAGS `$PYTHON-config --cflags`"
LDFLAGS="$LDFLAGS `$PYTHON-config --ldflags`"
LIBS="$LIBS `$PYTHON-config --libs`"
python_devel_embed=""
if $PYTHON-config --embed >/dev/null 2>/dev/null; then
python_devel_embed="--embed"
fi
LDFLAGS="$LDFLAGS `$PYTHON-config --ldflags $python_devel_embed`"
LIBS="$LIBS `$PYTHON-config --libs $python_devel_embed`"
unset python_devel_embed
fi
Reference in new issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.