summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDiego Elio Pettenò <flameeyes@gmail.com>2010-01-17 15:44:43 +0100
committerDiego Elio Pettenò <flameeyes@gmail.com>2010-01-17 15:44:43 +0100
commit8bdc6575b2ed9e663603ad98a99a448280dc989d (patch)
tree4f8e57a73ae7bb742342e002051339cce65a9d94
parentStandardise ./configure --help options reporting. (diff)
downloadlibvirt-8bdc6575b2ed9e663603ad98a99a448280dc989d.tar.gz
libvirt-8bdc6575b2ed9e663603ad98a99a448280dc989d.tar.bz2
libvirt-8bdc6575b2ed9e663603ad98a99a448280dc989d.zip
Change detection of xen so that it's actually automatic rather than forced.new
This ensures that ./configure will work fine if xen development packages are not around, rather than fail. When passing ./configure --with-xen, the lack of xen development packages become fatal.
-rw-r--r--configure.in60
1 files changed, 34 insertions, 26 deletions
diff --git a/configure.in b/configure.in
index 447d57e3f..8cbbfe5ce 100644
--- a/configure.in
+++ b/configure.in
@@ -205,7 +205,7 @@ fi
dnl Allow to build without Xen, QEMU/KVM, test or remote driver
AC_ARG_WITH([xen],
- AC_HELP_STRING([--with-xen], [add XEN support @<:@default=yes@:>@]),[],[with_xen=yes])
+ AC_HELP_STRING([--with-xen], [add XEN support @<:@default=check@:>@]),[],[with_xen=check])
AC_ARG_WITH([xen-inotify],
AC_HELP_STRING([--with-xen-inotify], [add XEN inotify support @<:@default=check@:>@]),[],[with_xen_inotify=check])
AC_ARG_WITH([qemu],
@@ -334,6 +334,8 @@ if test "$with_libvirtd" = "yes" ; then
fi
AM_CONDITIONAL([WITH_LIBVIRTD], [test "$with_libvirtd" = "yes"])
+old_LIBS="$LIBS"
+old_CFLAGS="$CFLAGS"
XEN_LIBS=""
XEN_CFLAGS=""
dnl search for the Xen store library
@@ -343,52 +345,58 @@ if test "$with_xen" != "no" ; then
XEN_LIBS="-L$with_xen/lib64 -L$with_xen/lib"
fi
fail=0
- old_LIBS="$LIBS"
- old_CFLAGS="$CFLAGS"
CFLAGS="$CFLAGS $XEN_CFLAGS"
LIBS="$LIBS $XEN_LIBS"
AC_CHECK_LIB([xenstore], [xs_read], [
with_xen=yes
XEN_LIBS="$XEN_LIBS -lxenstore"
],[
- if test "$with_xen" = "check" ; then
- with_xen=no
- else
- with_xen=no
+ if test "$with_xen" = "yes"; then
fail=1
fi
+ with_xen=no
])
+fi
- test $fail = 1 &&
- AC_MSG_ERROR([You must install the Xen development package to compile Xen driver with -lxenstore])
-
+if test "$with_xen" != "no" ; then
AC_CHECK_HEADERS([xen/xen.h xen/version.h xen/dom0_ops.h],,[
- AC_MSG_ERROR([Cannot find standard Xen headers. Is xen-devel installed?])
+ if test "$with_xen" = "yes"; then
+ fail=1
+ fi
+ with_xen=no
],
[#include <stdio.h>
#include <stdint.h>
])
+fi
+if test "$with_xen" != "no" ; then
dnl Search for the location of <xen/{linux,sys}/privcmd.h>.
- AC_CHECK_HEADERS([xen/sys/privcmd.h],,[
- AC_CHECK_HEADERS([xen/linux/privcmd.h],,[
- AC_MSG_ERROR([Cannot find header file <xen/linux/privcmd.h> or <xen/sys/privcmd.h>. Is xen-devel installed?])
- ],
-[#include <stdio.h>
-#include <stdint.h>
-#include <xen/xen.h>
-])
- ],
-[#include <stdio.h>
-#include <stdint.h>
-#include <xen/xen.h>
-])
- LIBS="$old_LIBS"
- CFLAGS="$old_CFLAGS"
+ found=
+ AC_CHECK_HEADERS([xen/sys/privcmd.h xen/linux/privcmd.h], [found=yes; break;], [],
+ [#include <stdio.h>
+ #include <stdint.h>
+ #include <xen/xen.h>
+ ])
+ if test "x$found" != "xyes"; then
+ if test "$with_xen" = "yes"; then
+ fail=1
+ fi
+ with_xen=no
+ fi
fi
+
+LIBS="$old_LIBS"
+CFLAGS="$old_CFLAGS"
+
+if test $fail = 1; then
+ AC_MSG_ERROR([You must install the Xen development package to compile Xen driver with -lxenstore])
+fi
+
if test "$with_xen" = "yes"; then
AC_DEFINE_UNQUOTED([WITH_XEN], 1, [whether Xen driver is enabled])
fi
+
AM_CONDITIONAL([WITH_XEN], [test "$with_xen" = "yes"])
AC_SUBST([XEN_CFLAGS])
AC_SUBST([XEN_LIBS])