public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* [Patch v2] Disable API tests if dependencies are not met
@ 2011-07-25 18:58 Conny Seidel
  2011-07-27 11:16 ` Avi Kivity
  0 siblings, 1 reply; 2+ messages in thread
From: Conny Seidel @ 2011-07-25 18:58 UTC (permalink / raw)
  To: avi; +Cc: kvm, Joerg.Roedel, Conny Seidel

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

Signed-of-by: Conny Seidel <conny.seidel@amd.com>
---
 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



^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-07-27 11:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-07-25 18:58 [Patch v2] Disable API tests if dependencies are not met Conny Seidel
2011-07-27 11:16 ` Avi Kivity

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox