configure: add check_insn function
authorMans Rullgard <mans@mansr.com>
Sat, 1 Dec 2012 15:06:56 +0000 (15:06 +0000)
committerMans Rullgard <mans@mansr.com>
Fri, 7 Dec 2012 16:54:03 +0000 (16:54 +0000)
The check_insn function tests an instruction in both inline asm and
standalone assembly, and sets _external/_inline config properties
accordingly.

Signed-off-by: Mans Rullgard <mans@mansr.com>
configure

index fe95251..6758438 100755 (executable)
--- a/configure
+++ b/configure
@@ -698,6 +698,12 @@ void foo(void){ __asm__ volatile($code); }
 EOF
 }
 
+check_insn(){
+    log check_insn "$@"
+    check_inline_asm ${1}_inline "\"$2\""
+    echo "$2" | check_as && enable ${1}_external || disable ${1}_external
+}
+
 check_yasm(){
     log check_yasm "$@"
     echo "$1" > $TMPS