[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [XEN PATCH for-4.13] configure: Fix test for python 3.8



On Fri, Nov 15, 2019 at 04:15:32PM +0000, Anthony PERARD wrote:
> 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@xxxxxxxxxx>
> ---
> 
> Notes:
>     You may want to rerun ./autogen.sh on commit.

Indeed. This patch introduces a lot of unrelated changes, presumably due
to the difference in autoconf.

> diff --git a/m4/python_devel.m4 b/m4/python_devel.m4
> index e365cd658e0e..bbf1e0354b2b 100644
> --- a/m4/python_devel.m4
> +++ b/m4/python_devel.m4
> @@ -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
>  ])

Acked-by: Wei Liu <wl@xxxxxxx>

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.