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 <mans@mansr.com>
This commit is contained in:
parent
f0fe245bc3
commit
7fd90119bb
15
configure
vendored
15
configure
vendored
@ -682,9 +682,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(){
|
||||||
@ -693,7 +693,7 @@ 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
|
||||||
}
|
}
|
||||||
@ -3266,8 +3266,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
|
||||||
|
Loading…
Reference in New Issue
Block a user