From 7fd90119bbf19632135eec59bb2cd4eb30315513 Mon Sep 17 00:00:00 2001 From: Mans Rullgard Date: Sat, 1 Dec 2012 13:19:05 +0000 Subject: [PATCH 1/2] configure: clean up check_inline_asm and check_as functions The check_inline_asm function should check the actual C compiler, not the one used for assembly files. Usually these are the same, but they might be different, typically when using a compiler other than gcc. The check_as should, as its name suggests, test the type of input the AS command is used with, i.e. a standalond assembly (.S) file. Finally, check for gnu assembler using the modified check_as as this reflects actual usage. Signed-off-by: Mans Rullgard --- configure | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/configure b/configure index ad0b525acf..fe95251c68 100755 --- a/configure +++ b/configure @@ -682,9 +682,9 @@ as_o(){ check_as(){ log check_as "$@" - cat > $TMPC - log_file $TMPC - check_cmd $as $CPPFLAGS $ASFLAGS "$@" $AS_C $(as_o $TMPO) $TMPC + cat > $TMPS + log_file $TMPS + check_cmd $as $CPPFLAGS $ASFLAGS "$@" $AS_C $(as_o $TMPO) $TMPS } check_inline_asm(){ @@ -693,7 +693,7 @@ check_inline_asm(){ code="$2" shift 2 disable $name - check_as "$@" < Date: Sat, 1 Dec 2012 15:06:56 +0000 Subject: [PATCH 2/2] configure: add check_insn function 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 --- configure | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/configure b/configure index fe95251c68..6758438e11 100755 --- 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