Merge commit 'c6ebc9faa2210d7f36a3036c357f6f199520f575'
* commit 'c6ebc9faa2210d7f36a3036c357f6f199520f575': configure: add check_insn function configure: clean up check_inline_asm and check_as functions Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
21
configure
vendored
21
configure
vendored
@@ -740,9 +740,9 @@ as_o(){
|
|||||||
|
|
||||||
check_as(){
|
check_as(){
|
||||||
log check_as "$@"
|
log check_as "$@"
|
||||||
cat > $TMPC
|
cat > $TMPS
|
||||||
log_file $TMPC
|
log_file $TMPS
|
||||||
check_cmd $as $CPPFLAGS $ASFLAGS "$@" $AS_C $(as_o $TMPO) $TMPC
|
check_cmd $as $CPPFLAGS $ASFLAGS "$@" $AS_C $(as_o $TMPO) $TMPS
|
||||||
}
|
}
|
||||||
|
|
||||||
check_inline_asm(){
|
check_inline_asm(){
|
||||||
@@ -751,11 +751,17 @@ check_inline_asm(){
|
|||||||
code="$2"
|
code="$2"
|
||||||
shift 2
|
shift 2
|
||||||
disable $name
|
disable $name
|
||||||
check_as "$@" <<EOF && enable $name
|
check_cc "$@" <<EOF && enable $name
|
||||||
void foo(void){ __asm__ volatile($code); }
|
void foo(void){ __asm__ volatile($code); }
|
||||||
EOF
|
EOF
|
||||||
}
|
}
|
||||||
|
|
||||||
|
check_insn(){
|
||||||
|
log check_insn "$@"
|
||||||
|
check_inline_asm ${1}_inline "\"$2\""
|
||||||
|
echo "$2" | check_as && enable ${1}_external || disable ${1}_external
|
||||||
|
}
|
||||||
|
|
||||||
check_yasm(){
|
check_yasm(){
|
||||||
log check_yasm "$@"
|
log check_yasm "$@"
|
||||||
echo "$1" > $TMPS
|
echo "$1" > $TMPS
|
||||||
@@ -3611,8 +3617,13 @@ fi
|
|||||||
|
|
||||||
if enabled asm; then
|
if enabled asm; then
|
||||||
as=${gas:=$as}
|
as=${gas:=$as}
|
||||||
check_inline_asm gnu_as '".macro m n\n\\n:.int 0\n.endm\nm x"' ||
|
check_as <<EOF && enable gnu_as || \
|
||||||
$nogas "GNU assembler not found, install gas-preprocessor"
|
$nogas "GNU assembler not found, install gas-preprocessor"
|
||||||
|
.macro m n
|
||||||
|
\n: .int 0
|
||||||
|
.endm
|
||||||
|
m x
|
||||||
|
EOF
|
||||||
fi
|
fi
|
||||||
|
|
||||||
check_ldflags -Wl,--as-needed
|
check_ldflags -Wl,--as-needed
|
||||||
|
Reference in New Issue
Block a user