@@ -160,7 +160,7 @@ clean:
done
distclean: clean
- rm -f config-host.mak config-host.h* config-host.ld $(DOCS) qemu-options.texi qemu-img-cmds.texi qemu-monitor.texi
+ rm -f config-host.mak config-host.h* config-host.ld $(DOCS) qemu-options.texi qemu-img-cmds.texi qemu-monitor.texi config.log
rm -f qemu-options.def
rm -f config-all-devices.mak
rm -f roms/seabios/config.mak roms/vgabios/config.mak
@@ -20,16 +20,26 @@ TMPE="${TMPDIR1}/qemu-conf-${RANDOM}-$$-${RANDOM}.exe"
trap "rm -f $TMPC $TMPO $TMPE" EXIT INT QUIT TERM
rm -f config.log
+run_cc() {
+ echo "$cc $@" >&5
+ if $cc "$@" >&5 2>&5; then
+ return 0
+ else
+ echo exit status is $? >&5
+ echo failed program was: >&5
+ sed 's/^/| /' $TMPC >&5
+ return 1
+ fi
+}
+
compile_object() {
- echo $cc $QEMU_CFLAGS -c -o $TMPO $TMPC >> config.log
- $cc $QEMU_CFLAGS -c -o $TMPO $TMPC >> config.log 2>&1
+ run_cc $QEMU_CFLAGS -c -o $TMPO $TMPC
}
compile_prog() {
local_cflags="$1"
local_ldflags="$2"
- echo $cc $QEMU_CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags >> config.log
- $cc $QEMU_CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags >> config.log 2>&1
+ run_cc $QEMU_CFLAGS $local_cflags -o $TMPE $TMPC $LDFLAGS $local_ldflags
}
# check whether a command is available to this shell (may be either an
@@ -906,6 +916,9 @@ echo "NOTE: The object files are built at the place where configure is launched"
exit 1
fi
+# create config.log file
+exec 5>config.log
+
# check that the C compiler works.
cat > $TMPC <<EOF
int main(void) {}
Also clean config.log from distclean. Signed-off-by: Paolo Bonzini <pbonzini@redhat.com> --- Makefile | 2 +- configure | 21 +++++++++++++++++---- 2 files changed, 18 insertions(+), 5 deletions(-)