summaryrefslogtreecommitdiffstats
path: root/configure.ac
diff options
context:
space:
mode:
authorArun Raghavan <arun.raghavan@collabora.co.uk>2010-11-26 11:55:57 +0530
committerColin Guthrie <cguthrie@mandriva.org>2010-11-28 16:58:38 +0000
commitf6574c8c225859ba2b2ddefd7593d4aac97b0c05 (patch)
tree64b5ae34851a125d26862049e10ade7626ad4d38 /configure.ac
parent70f69ac519981d50d1242a0eefb703dcef5615ab (diff)
volume: Add explicit checks for ARMv6 instructions
This ensures that the build does not fail if the ssat and pkhbt instructions are not available (armv5te and below). Fixes: http://www.pulseaudio.org/ticket/790
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac33
1 files changed, 32 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index dea8bb9c..2c233c89 100644
--- a/configure.ac
+++ b/configure.ac
@@ -240,7 +240,7 @@ else
[pulseaudio_cv_support_arm_atomic_ops=no])
])
AS_IF([test "$pulseaudio_cv_support_arm_atomic_ops" = "yes"], [
- AC_DEFINE([ATOMIC_ARM_INLINE_ASM], 1, [Have ARMv6 instructions.])
+ AC_DEFINE([ATOMIC_ARM_INLINE_ASM], 1, [Have ARM atomic instructions.])
need_libatomic_ops=no
])
fi
@@ -257,6 +257,37 @@ else
esac
fi
+# If we're on ARM, check for the ARMV6 instructions we need */
+case $host in
+ arm*)
+ AC_CACHE_CHECK([support for required armv6 instructions],
+ pulseaudio_cv_support_armv6,
+ [AC_COMPILE_IFELSE(
+ AC_LANG_PROGRAM([],
+ [[volatile int a = -60000, b = 0xaaaabbbb, c = 0xccccdddd;
+ asm volatile ("ldr r0, %2 \n"
+ "ldr r2, %3 \n"
+ "ldr r3, %4 \n"
+ "ssat r1, #8, r0 \n"
+ "str r1, %0 \n"
+ "pkhbt r1, r3, r2, LSL #8 \n"
+ "str r1, %1 \n"
+ : "=m" (a), "=m" (b)
+ : "m" (a), "m" (b), "m" (c)
+ : "r0", "r1", "r2", "r3", "cc");
+ return (a == -128 && b == 0xaabbdddd) ? 0 : -1;
+ ]]),
+ [pulseaudio_cv_support_armv6=yes],
+ [pulseaudio_cv_support_armv6=no])
+ ])
+ AS_IF([test "$pulseaudio_cv_support_armv6" = "yes"], [
+ AC_DEFINE([HAVE_ARMV6], 1, [Have ARMv6 instructions.])
+ ])
+ ;;
+ *)
+ ;;
+esac
+
CC_CHECK_TLS
AC_CACHE_CHECK([whether $CC knows _Bool],