[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v2] autoconf: fix python-dev detection on old python versions
This patch isn't working, still get the same error. best regards yang > -----Original Message----- > From: Roger Pau Monné [mailto:royger@xxxxxxxxx] On Behalf Of Roger Pau > Monne > Sent: Friday, March 30, 2012 3:36 PM > To: xen-devel@xxxxxxxxxxxxx > Cc: Roger Pau Monne; Zhang, Yang Z; KUWAMURA Shin'ya; Ian Campbell > Subject: [PATCH v2] autoconf: fix python-dev detection on old python versions > > Replaced the use of python-config (that is only present in Python >= 2.5.x) > with the distutils python module. > > Please run ./autogen.sh after applying the patch. > > Again, this has only been tested on OS X Python 2.7. > > Changes since v1: > > * Added Python LDFLAGS to library test. > > Signed-off-by: Roger Pau Monne <roger.pau@xxxxxxxxxxxxx> > Cc: Zhang, Yang Z <yang.z.zhang@xxxxxxxxx> > Cc: KUWAMURA Shin'ya <kuwa@xxxxxxxxxxxxxx> > Cc: Ian Campbell <ian.campbell@xxxxxxxxxx> > --- > tools/m4/python_devel.m4 | 36 +++++++++++++++++------------------- > 1 files changed, 17 insertions(+), 19 deletions(-) > > diff --git a/tools/m4/python_devel.m4 b/tools/m4/python_devel.m4 > index 3bcca7b..dada92a 100644 > --- a/tools/m4/python_devel.m4 > +++ b/tools/m4/python_devel.m4 > @@ -1,27 +1,25 @@ > AC_DEFUN([AX_CHECK_PYTHON_DEVEL], [ > +ac_python_version=`$PYTHON -c 'import distutils.sysconfig; \ > + print distutils.sysconfig.get_config_var("VERSION")'` > ac_previous_cppflags=$CPPFLAGS > -CPPFLAGS="$CFLAGS `$PYTHON-config --includes`" > +CPPFLAGS="$CFLAGS `$PYTHON -c 'import distutils.sysconfig; \ > + print "-I" + distutils.sysconfig.get_config_var("INCLUDEPY")'`" > +CPPFLAGS="$CPPFLAGS `$PYTHON -c 'import distutils.sysconfig; \ > + print distutils.sysconfig.get_config_var("CFLAGS")'`" > ac_previous_ldflags=$LDFLAGS > -for flag in `$PYTHON-config --ldflags` > -do > - case $flag in > - -L*) > - LDFLAGS="$LDLFAGS $flag" > - ;; > - -lpython*) > - python_lib=`echo $flag | sed 's/^-l//'` > - ;; > - -l*) > - # Ignore other libraries, we are only interested in testing > python-dev > - ;; > - *) > - AC_MSG_WARN([Strange ldflag found in $PYTHON-config output: > $flag]) > - ;; > - esac > -done > +LDFLAGS="$LDFLAGS `$PYTHON -c 'import distutils.sysconfig; \ > + print distutils.sysconfig.get_config_var("LIBS")'`" > +LDFLAGS="$LDFLAGS `$PYTHON -c 'import distutils.sysconfig; \ > + print "-L" + distutils.sysconfig.get_python_lib(plat_specific=1,\ > + standard_lib=1) + "/config"'`" > +LDFLAGS="$LDFLAGS `$PYTHON -c 'import distutils.sysconfig; \ > + print distutils.sysconfig.get_config_var("LINKFORSHARED")'`" > +LDFLAGS="$LDFLAGS `$PYTHON -c 'import distutils.sysconfig; \ > + print distutils.sysconfig.get_config_var("LDFLAGS")'`" > + > AC_CHECK_HEADER([Python.h], [], > [AC_MSG_ERROR([Unable to find Python development headers])],) > -AC_CHECK_LIB($python_lib, PyArg_ParseTuple, [], > +AC_CHECK_LIB(python$ac_python_version, PyArg_ParseTuple, [], > [AC_MSG_ERROR([Unable to find a suitable python development > library])]) > CPPFLAGS=$ac_previous_cppflags > LDLFAGS=$ac_previous_ldflags > -- > 1.7.7.5 (Apple Git-26) _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx http://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |