[libvirt] [PATCH] configure.ac: avoid uname, which breaks cross-compilation

Eric Blake eblake at redhat.com
Mon May 3 23:26:01 UTC 2010


Without this patch, compiling to mingw with a $build on windows
(think MSYS or cygwin) worked, but failed with a $build on Linux.

* configure.ac: Fix cross-compilation from Linux to mingw.
Reported by Matthias Bolte.
---
 configure.ac |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/configure.ac b/configure.ac
index 0fb8bd9..3225cfa 100644
--- a/configure.ac
+++ b/configure.ac
@@ -197,8 +197,8 @@ if test "$prefix" = "/usr" && test "$sysconfdir" = '${prefix}/etc' ; then
 fi

 dnl lxc and qemu drivers require linux headers
-if test `uname -s` != "Linux"
-then
+case $host in
+    linux*)
     if test "x$with_lxc" != "xyes"
     then
         with_lxc=no
@@ -207,7 +207,8 @@ then
     then
         with_qemu=no
     fi
-fi
+    ;;
+esac

 dnl Allow to build without Xen, QEMU/KVM, test or remote driver
 AC_ARG_WITH([xen],
@@ -1970,7 +1971,11 @@ then
 fi
 AM_CONDITIONAL([WITH_NODE_DEVICES], [test "$with_nodedev" = "yes"])

-AM_CONDITIONAL([WITH_LINUX], [test `uname -s` = "Linux"])
+case $host in
+  linux*) with_linux=yes ;;
+  *) with_linux=no ;;
+esac
+AM_CONDITIONAL([WITH_LINUX], [test $with_linux = yes])


 AC_ARG_WITH([qemu-user],
-- 
1.6.6.1




More information about the libvir-list mailing list