]> xenbits.xensource.com Git - libvirt.git/commitdiff
configure.ac: Avoid uname, which breaks cross-compilation
authorMatthias Bolte <matthias.bolte@googlemail.com>
Mon, 3 May 2010 23:41:55 +0000 (01:41 +0200)
committerEric Blake <eblake@redhat.com>
Tue, 4 May 2010 16:39:12 +0000 (10:39 -0600)
When cross-compiling on Linux, configure will misdetect the target as
Linux because it uses uname instead of relying on the $host variable.
This results in including libvirt_linux.syms into libvirt.syms and
therefore trying to export undefined symbols.

Replace uname checks with $host checks to fix this.

configure.ac

index 6ee5b9028268b239cf73cdb56c66cb9b39dd8401..5d68dcc38518eb2666c1f3c99c163c6f3fc3493e 100644 (file)
@@ -210,8 +210,11 @@ 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*)
+    # match linux here so the *) case will match anything non-linux
+    ;;
+  *)
     if test "x$with_lxc" != "xyes"
     then
         with_lxc=no
@@ -220,7 +223,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],
@@ -1983,7 +1987,13 @@ then
 fi
 AM_CONDITIONAL([WITH_NODE_DEVICES], [test "$with_nodedev" = "yes"])
 
-AM_CONDITIONAL([WITH_LINUX], [test `uname -s` = "Linux"])
+with_linux=no
+case "$host" in
+  *-*-linux*)
+    with_linux=yes
+    ;;
+esac
+AM_CONDITIONAL([WITH_LINUX], [test "$with_linux" = "yes"])
 
 
 AC_ARG_WITH([qemu-user],