提交 af2d37de 编写于 作者: S Stefan Weil 提交者: Stefan Hajnoczi

configure: Avoid duplicate flags when calling compile_prog

This patch removes redundant shell code and cleans it a little bit.

Shell macro compile_prog takes two arguments:
local_cflags and local ldflags.

$QEMU_CFLAGS is added automatically to the cflags, so there is no need
to pass it as an argument.

It is also unnecessary to pass -Werror twice.

$flag is a compiler warning option, so it should be in local_cflags
instead of local_ldflags.
Signed-off-by: NStefan Weil <weil@mail.berlios.de>
Signed-off-by: NStefan Hajnoczi <stefanha@linux.vnet.ibm.com>
上级 c1ba4e0b
......@@ -1070,7 +1070,7 @@ cat > $TMPC << EOF
int main(void) { return 0; }
EOF
for flag in $gcc_flags; do
if compile_prog "-Werror $QEMU_CFLAGS" "-Werror $flag" ; then
if compile_prog "$flag -Werror" "" ; then
QEMU_CFLAGS="$QEMU_CFLAGS $flag"
fi
done
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册