[Patch v2] Disable API tests if dependencies are not met

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Add runtime detection of 32bit libraries to prevent build fails.

Signed-of-by: Conny Seidel <conny.seidel@xxxxxxx>
---
 config-x86-common.mak |    2 ++
 configure             |   17 +++++++++++++++++
 2 files changed, 19 insertions(+), 0 deletions(-)

diff --git a/config-x86-common.mak b/config-x86-common.mak
index 033bae0..1cbc7c6 100644
--- a/config-x86-common.mak
+++ b/config-x86-common.mak
@@ -36,8 +36,10 @@ tests-common = $(TEST_DIR)/vmexit.flat $(TEST_DIR)/tsc.flat \
                $(TEST_DIR)/kvmclock_test.flat  $(TEST_DIR)/eventinj.flat \
                $(TEST_DIR)/s3.flat
 
+ifdef API
 tests-common += api/api-sample
 tests-common += api/dirty-log
+endif
 
 tests_and_config = $(TEST_DIR)/*.flat $(TEST_DIR)/unittests.cfg
 
diff --git a/configure b/configure
index efb8705..d0c62e2 100755
--- a/configure
+++ b/configure
@@ -63,6 +63,22 @@ while [[ "$1" = -* ]]; do
     esac
 done
 
+# check for dependent 32 bit libraries
+cat << EOF > lib_test.c
+#include <stdc++.h>
+#include <boost_thread-mt.h>
+#include <pthread.h>
+
+int main ()
+{}
+EOF
+$cc -m32 -o /dev/null lib_test.c &> /dev/null
+exit=$?
+if [ $exit -eq 0 ]; then
+    api=true
+fi
+rm -f lib_test.c
+
 cat <<EOF > config.mak
 PREFIX=$prefix
 KERNELDIR=$(readlink -f $kerneldir)
@@ -72,4 +88,5 @@ CC=$cross_prefix$cc
 LD=$cross_prefix$ld
 OBJCOPY=$cross_prefix$objcopy
 AR=$cross_prefix$ar
+API=$api
 EOF
-- 
1.7.2.3


--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [KVM ARM]     [KVM ia64]     [KVM ppc]     [Virtualization Tools]     [Spice Development]     [Libvirt]     [Libvirt Users]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite Questions]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux