fix libvirt-python build problem

The current libvirt's config.log:
configure:65065: checking for python
configure:65083: found /usr/bin/python
configure:65095: result: /usr/bin/python
configure:65116: checking for python version
configure:65123: result: 2.7
configure:65137: checking for python platform
configure:65144: result: linux2
configure:65170: checking for python script directory
configure:65206: result: ${prefix}/lib/python2.7/dist-packages
configure:65215: checking for python extension module directory
configure:65251: result: ${exec_prefix}/lib/python2.7/dist-packages

so it will use host python which may quite different with target python.

remove python_incdir.patch and inherit pythonnative.
use PACKAGECONFIG instead of EXTRA_OECONF.
enable python in full PACKAGECONFIG.

Signed-off-by: Yao Zhao <yao.zhao@windriver.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
This commit is contained in:
Yao Zhao 2013-05-03 14:28:39 -04:00 committed by Bruce Ashfield
parent bb8c2c420b
commit 22e7b5e92b
3 changed files with 13 additions and 81 deletions

View File

@ -1,14 +1,17 @@
inherit python-dir
inherit pythonnative python-dir
# Enable the Python tool support
EXTRA_OECONF += "--with-python=yes --with-python-inc-dir=-I${STAGING_INCDIR}/python${PYTHON_BASEVERSION}"
export STAGING_INCDIR
export STAGING_LIBDIR
export BUILD_SYS
export HOST_SYS
SRC_URI += " file://python_incdir.patch"
DEPENDS += "python python-native"
PACKAGECONFIG += "python"
PACKAGECONFIG[python] = "--with-python,--without-python,python,"
RDEPENDS_${PN}-python += "python"
PACKAGECONFIG_${PN}-python[xen] = ",,,xen-python"
PACKAGES += "${PN}-python-dbg ${PN}-python"
FILES_${PN}-python-dbg += "${libdir}/${PYTHON_DIR}/site-packages/.debug/"
FILES_${PN}-python += "${libdir}/${PYTHON_DIR}/site-packages"
PACKAGES += "${PN}-python-staticdev ${PN}-python-dev ${PN}-python-dbg ${PN}-python"
FILES_${PN}-python-staticdev += "${PYTHON_SITEPACKAGES_DIR}/*.a"
FILES_${PN}-python-dev += "${PYTHON_SITEPACKAGES_DIR}/*.la"
FILES_${PN}-python-dbg += "${PYTHON_SITEPACKAGES_DIR}/.debug/"
FILES_${PN}-python += "${PYTHON_SITEPACKAGES_DIR}"

View File

@ -1,71 +0,0 @@
Index: libvirt-1.0.3/configure.ac
===================================================================
--- libvirt-1.0.3.orig/configure.ac
+++ libvirt-1.0.3/configure.ac
@@ -1878,6 +1878,11 @@ fi
PYTHON_VERSION=
PYTHON_INCLUDES=
+
+AC_ARG_WITH(python-inc-dir,
+ AS_HELP_STRING([--with-python-inc-dir=DIR], [directory with Python include files]),
+ [PYTHON_INCLUDES="${withval}"], [])
+
if test "$with_python" != "no" ; then
if test -x "$with_python/bin/python"
then
@@ -1901,31 +1906,32 @@ if test "$with_python" != "no" ; then
if test "$with_python" = "yes" ; then
AM_PATH_PYTHON(,, [:])
-
+ pyexecdir=$prefix/lib/python$PYTHON_VERSION/site-packages
if test "$PYTHON" != : ; then
- PYTHON_CONFIG="$PYTHON-config"
-
- if test -x "$PYTHON_CONFIG"
- then
- PYTHON_INCLUDES=`$PYTHON_CONFIG --includes`
- else
- if test -r $PYTHON_EXEC_PREFIX/include/python$PYTHON_VERSION/Python.h
- then
- PYTHON_INCLUDES=-I$PYTHON_EXEC_PREFIX/include/python$PYTHON_VERSION
- else
- if test -r $prefix/include/python$PYTHON_VERSION/Python.h
- then
- PYTHON_INCLUDES=-I$prefix/include/python$PYTHON_VERSION
- else
- if test -r /usr/include/python$PYTHON_VERSION/Python.h
- then
- PYTHON_INCLUDES=-I/usr/include/python$PYTHON_VERSION
- else
- AC_MSG_ERROR([You must install python-devel to build Python bindings])
- fi
+ if ! test -n "$PYTHON_INCLUDES"; then
+ PYTHON_CONFIG="$PYTHON-config"
+ if test -x "$PYTHON_CONFIG"
+ then
+ PYTHON_INCLUDES=`$PYTHON_CONFIG --includes`
+ else
+ if test -r $PYTHON_EXEC_PREFIX/include/python$PYTHON_VERSION/Python.h
+ then
+ PYTHON_INCLUDES=-I$PYTHON_EXEC_PREFIX/include/python$PYTHON_VERSION
+ else
+ if test -r $prefix/include/python$PYTHON_VERSION/Python.h
+ then
+ PYTHON_INCLUDES=-I$prefix/include/python$PYTHON_VERSION
+ else
+ if test -r /usr/include/python$PYTHON_VERSION/Python.h
+ then
+ PYTHON_INCLUDES=-I/usr/include/python$PYTHON_VERSION
+ else
+ AC_MSG_ERROR([You must install python-devel to build Python bindings])
+ fi
+ fi
fi
fi
- fi
+ fi
else
AC_MSG_ERROR([You must install python to build Python bindings])
fi

View File

@ -106,7 +106,7 @@ INITSCRIPT_PARAMS_${PN}-libvirtd = "defaults 72"
# full config
PACKAGECONFIG ??= "qemu yajl xen libxl xen-inotify uml openvz vmware vbox esx \
polkit lxc test remote macvtap libvirtd netcf udev"
polkit lxc test remote macvtap libvirtd netcf udev python"
PACKAGECONFIG[qemu] = "--with-qemu,--without-qemu,qemu"
PACKAGECONFIG[yajl] = "--with-yajl,--without-yajl,yajl,yajl"