[libvirt] [PATCH] build: Fix problem of building Python bindings

Eric Blake eblake at redhat.com
Fri Apr 29 23:54:44 UTC 2011


On 04/26/2011 09:46 PM, Osier Yang wrote:
> If one specify "--with-python=yes" but no python-devel package
> is installed, we ignore it with just a notice message, which
> doesn't give clear guide to user.
> ---
>  configure.ac |    6 ++----
>  1 files changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 190bf40..758c893 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -1917,15 +1917,13 @@ if test "$with_python" != "no" ; then
>                          then
>                              PYTHON_INCLUDES=-I/usr/include/python$PYTHON_VERSION
>                          else
> -                            AC_MSG_NOTICE([Could not find python$PYTHON_VERSION/Python.h, disabling bindings])
> -                            with_python=no
> +                            AC_MSG_ERROR([You must install python-devel to build Python bindings])

Hmm, this patch isn't quite right.  I tested on an Ubuntu system where I
don't have the devel package installed for python, and to my surprise,
./configure now fails, where it used to succeed without building any
python bindings:

configure: error: You must install python-devel to build Python bindings

In reality, we want the default to be --with-python=check, which
gracefully switches to --with-python=no if python is not present, and
only issue the AC_MSG_ERROR on an explicit --with-python=yes without
python bindings.  I ran out of time to look at this today, but think it
needs to be fixed before 0.9.1.

-- 
Eric Blake   eblake at redhat.com    +1-801-349-2682
Libvirt virtualization library http://libvirt.org

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 619 bytes
Desc: OpenPGP digital signature
URL: <http://listman.redhat.com/archives/libvir-list/attachments/20110429/7f8174ce/attachment-0001.sig>


More information about the libvir-list mailing list