[kvm-unit-tests PATCH v2 1/5] configure: fix non-newlib cross-compiling

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

 



From: Andrew Jones <drjones@xxxxxxxxxx>

Commit 529046c3 "libcflat: add PRI(dux)32 format types" applies a
detection trick that requires native compiling or cross-compiling
with newlib, an embedded system C standard library. We can avoid
the new dependency with a different trick.

Signed-off-by: Andrew Jones <drjones@xxxxxxxxxx>
Signed-off-by: Alex Bennée <alex.bennee@xxxxxxxxxx>

---
v2 + ajb:
  - fix compiler invocation
---
 configure | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/configure b/configure
index 127868c..8821f37 100755
--- a/configure
+++ b/configure
@@ -12,6 +12,7 @@ host=$arch
 cross_prefix=
 endian=""
 pretty_print_stacks=yes
+u32_long=
 
 usage() {
     cat <<-EOF
@@ -110,16 +111,11 @@ if [ -f $testdir/run ]; then
 fi
 
 # check if uint32_t needs a long format modifier
-cat << EOF > lib_test.c
-#include <inttypes.h>
+cat << EOF > lib-test.c
+__UINT32_TYPE__
 EOF
-
-$cross_prefix$cc lib_test.c -E | grep "typedef" | grep "long" | grep "uint32_t" &> /dev/null
-exit=$?
-if [ $exit -eq 0 ]; then
-    u32_long=true
-fi
-rm -f lib_test.c
+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
-- 
2.11.0

--
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