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

Re: [Xen-devel] [PATCH for-next RFC 1/4] build/m4: make python_devel.m4 work with both python 2 and 3



On Wed, Mar 06, 2019 at 03:35:53PM +0000, Anthony PERARD wrote:
> On Wed, Mar 06, 2019 at 03:24:43PM +0000, Wei Liu wrote:
> > On Wed, Mar 06, 2019 at 03:07:16PM +0000, Anthony PERARD wrote:
> > > > -AC_CHECK_LIB(python$ac_python_version, PyArg_ParseTuple, [],
> > > > -    [AC_MSG_ERROR([Unable to find a suitable python development 
> > > > library])],
> > > > -    [$PYTHON_LIBS])
> > > > +AC_CHECK_LIB(python$ac_python_version$ac_python_abiflags, 
> > > > PyArg_ParseTuple, [],
> > > > +    [AC_MSG_ERROR([Unable to find a suitable python development 
> > > > library])])
> > > 
> > > So, AC_CHECK_LIB seems to only be used to check if PyArg_ParseTuple
> > > exist, and requires as argument the name of the lib which is now
> > > complicated.
> > > 
> > > But, AC_CHECK_LIB do test compilation using the LDFLAGS which already
> > > contain the python lib we want, so instead, we could only do the part of
> > > the jobs that we need:
> > > 
> > > AC_LINK_IFELSE([AC_LANG_CALL([], [PyArg_ParseTuple])], [],
> > >     [AC_MSG_ERROR([Unable to find a suitable python development 
> > > library])])
> > > 
> > > That generate a main.c with PyArg_ParseTuple() call like AC_CHECK_LIB
> > > do, and do build/link. If that fails, throw an error.
> > > 
> > > That avoid to use the --abiflags, which we don't need.
> > > 
> > > What do you thing?
> > 
> > Definitely looks better. Let me try this.
> 
> Actually, I think I just found better, same things but using a macro
> that already do what we want:
> 
> AC_CHECK_FUNC([PyArg_ParseTuple], [],
>     [AC_MSG_ERROR([Unable to find a suitable python development library])])
> 

This works. Thank you.

Wei.

> -- 
> Anthony PERARD

_______________________________________________
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®.