From: "Radim Krčmář" <rkrcmar@redhat.com>
To: kvm@vger.kernel.org
Cc: Paolo Bonzini <pbonzini@redhat.com>
Subject: [kvm-unit-tests PATCH 1/2] configure: improve api/ detection
Date: Fri, 19 May 2017 18:48:17 +0200 [thread overview]
Message-ID: <20170519164818.21375-2-rkrcmar@redhat.com> (raw)
In-Reply-To: <20170519164818.21375-1-rkrcmar@redhat.com>
API was never selected by default, because <stdc++> should have been
<bits/stdc++> and in any case needs g++. Boost dependency has recently
been lifted, but we added gnu++11 dependency.
Only x86 currently uses compiles api, so make the room for errors a bit
smaller by checking for it.
Signed-off-by: Radim Krčmář <rkrcmar@redhat.com>
---
configure | 32 ++++++++++++++++----------------
1 file changed, 16 insertions(+), 16 deletions(-)
diff --git a/configure b/configure
index 2586131b6eff..64722c9b263b 100755
--- a/configure
+++ b/configure
@@ -3,6 +3,7 @@
srcdir=$(cd "$(dirname "$0")"; pwd)
prefix=/usr/local
cc=gcc
+cxx=g++
ld=ld
objcopy=objcopy
objdump=objdump
@@ -24,6 +25,7 @@ usage() {
--processor=PROCESSOR processor to compile for ($arch)
--cross-prefix=PREFIX cross compiler prefix
--cc=CC c compiler to use ($cc)
+ --cxx=CXX c++ compiler to use ($cxx)
--ld=LD ld linker to use ($ld)
--prefix=PREFIX where to install things ($prefix)
--endian=ENDIAN endianness to compile for (little or big, ppc64 only)
@@ -59,6 +61,9 @@ while [[ "$1" = -* ]]; do
--cc)
cc="$arg"
;;
+ --cxx)
+ cxx="$arg"
+ ;;
--ld)
ld="$arg"
;;
@@ -118,22 +123,16 @@ EOF
u32_long=$($cross_prefix$cc -E lib-test.c | grep -v '^#' | grep -q long && echo yes)
rm -f lib-test.c
-# check for dependent 32 bit libraries
-if [ "$arch" != "arm" ]; then
-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
+# api/: check for dependent 32 bit libraries and gnu++11 support
+if [ "$testdir" = "x86" ]; then
+ echo 'int main () {}' > lib-test.c
+ $cc -m32 -o /dev/null -lstdc++ -lpthread -lrt lib-test.c &> /dev/null
+ exit=$?
+ $cxx -m32 -o /dev/null -std=gnu++11 lib-test.c &> /dev/null
+ if [ $? -eq 0 -a $exit -eq 0 ]; then
+ api=true
+ fi
+ rm -f lib-test.c
fi
# Are we in a separate build tree? If so, link the Makefile
@@ -173,6 +172,7 @@ ARCH=$arch
ARCH_NAME=$arch_name
PROCESSOR=$processor
CC=$cross_prefix$cc
+CXX=$cross_prefix$cxx
LD=$cross_prefix$ld
OBJCOPY=$cross_prefix$objcopy
OBJDUMP=$cross_prefix$objdump
--
2.13.0
next prev parent reply other threads:[~2017-05-19 16:48 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-19 16:48 [kvm-unit-tests PATCH 0/2] api/x86: build improvements Radim Krčmář
2017-05-19 16:48 ` Radim Krčmář [this message]
2017-05-19 16:48 ` [kvm-unit-tests PATCH 2/2] api/x86: sanitize Makefile Radim Krčmář
2017-05-19 16:51 ` [kvm-unit-tests PATCH 0/2] api/x86: build improvements Paolo Bonzini
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170519164818.21375-2-rkrcmar@redhat.com \
--to=rkrcmar@redhat.com \
--cc=kvm@vger.kernel.org \
--cc=pbonzini@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.