Skip to content

Commit

Permalink
mingw: add version information to the executables
Browse files Browse the repository at this point in the history
Add QEMU version information to the executables, based on earlier
work by C. W. Betts and Robert Riebisch.

Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
  • Loading branch information
blueswirl committed Sep 26, 2010
1 parent 0ba8681 commit 9fe6de9
Show file tree
Hide file tree
Showing 4 changed files with 48 additions and 3 deletions.
10 changes: 7 additions & 3 deletions Makefile
Expand Up @@ -114,16 +114,20 @@ trace.o: trace.c $(GENERATED_HEADERS)

simpletrace.o: simpletrace.c $(GENERATED_HEADERS)

version.o: $(SRC_PATH)/version.rc config-host.mak
$(call quiet-command,$(WINDRES) -I. -o $@ $<," RC $(TARGET_DIR)$@")

version-obj-$(CONFIG_WIN32) += version.o
######################################################################

qemu-img.o: qemu-img-cmds.h
qemu-img.o qemu-tool.o qemu-nbd.o qemu-io.o: $(GENERATED_HEADERS)

qemu-img$(EXESUF): qemu-img.o qemu-tool.o qemu-error.o $(trace-obj-y) $(block-obj-y) $(qobject-obj-y)
qemu-img$(EXESUF): qemu-img.o qemu-tool.o qemu-error.o $(trace-obj-y) $(block-obj-y) $(qobject-obj-y) $(version-obj-y)

qemu-nbd$(EXESUF): qemu-nbd.o qemu-tool.o qemu-error.o $(trace-obj-y) $(block-obj-y) $(qobject-obj-y)
qemu-nbd$(EXESUF): qemu-nbd.o qemu-tool.o qemu-error.o $(trace-obj-y) $(block-obj-y) $(qobject-obj-y) $(version-obj-y)

qemu-io$(EXESUF): qemu-io.o cmd.o qemu-tool.o qemu-error.o $(trace-obj-y) $(block-obj-y) $(qobject-obj-y)
qemu-io$(EXESUF): qemu-io.o cmd.o qemu-tool.o qemu-error.o $(trace-obj-y) $(block-obj-y) $(qobject-obj-y) $(version-obj-y)

qemu-img-cmds.h: $(SRC_PATH)/qemu-img-cmds.hx
$(call quiet-command,sh $(SRC_PATH)/hxtool -h < $< > $@," GEN $@")
Expand Down
1 change: 1 addition & 0 deletions Makefile.objs
Expand Up @@ -86,6 +86,7 @@ common-obj-y += block-migration.o

common-obj-$(CONFIG_BRLAPI) += baum.o
common-obj-$(CONFIG_POSIX) += migration-exec.o migration-unix.o migration-fd.o
common-obj-$(CONFIG_WIN32) += version.o

audio-obj-y = audio.o noaudio.o wavaudio.o mixeng.o
audio-obj-$(CONFIG_SDL) += sdlaudio.o
Expand Down
12 changes: 12 additions & 0 deletions configure
Expand Up @@ -83,6 +83,7 @@ install="install"
objcopy="objcopy"
ld="ld"
strip="strip"
windres="windres"
helper_cflags=""
libs_softmmu=""
libs_tools=""
Expand Down Expand Up @@ -129,6 +130,7 @@ ar="${cross_prefix}${ar}"
objcopy="${cross_prefix}${objcopy}"
ld="${cross_prefix}${ld}"
strip="${cross_prefix}${strip}"
windres="${cross_prefix}${windres}"

# default flags for all hosts
QEMU_CFLAGS="-fno-strict-aliasing $QEMU_CFLAGS"
Expand Down Expand Up @@ -2319,6 +2321,15 @@ fi
echo "HOST_LONG_BITS=$hostlongbits" >> $config_host_mak
if test "$mingw32" = "yes" ; then
echo "CONFIG_WIN32=y" >> $config_host_mak
rc_version=`cat $source_path/VERSION`
version_major=${rc_version%%.*}
rc_version=${rc_version#*.}
version_minor=${rc_version%%.*}
rc_version=${rc_version#*.}
version_subminor=${rc_version%%.*}
version_micro=0
echo "CONFIG_FILEVERSION=$version_major,$version_minor,$version_subminor,$version_micro" >> $config_host_mak
echo "CONFIG_PRODUCTVERSION=$version_major,$version_minor,$version_subminor,$version_micro" >> $config_host_mak
else
echo "CONFIG_POSIX=y" >> $config_host_mak
fi
Expand Down Expand Up @@ -2565,6 +2576,7 @@ fi
echo "AR=$ar" >> $config_host_mak
echo "OBJCOPY=$objcopy" >> $config_host_mak
echo "LD=$ld" >> $config_host_mak
echo "WINDRES=$windres" >> $config_host_mak
echo "CFLAGS=$CFLAGS" >> $config_host_mak
echo "QEMU_CFLAGS=$QEMU_CFLAGS" >> $config_host_mak
echo "HELPER_CFLAGS=$helper_cflags" >> $config_host_mak
Expand Down
28 changes: 28 additions & 0 deletions version.rc
@@ -0,0 +1,28 @@
#include <winver.h>
#include "config-host.h"

VS_VERSION_INFO VERSIONINFO
FILEVERSION CONFIG_FILEVERSION
PRODUCTVERSION CONFIG_PRODUCTVERSION
FILEFLAGSMASK VS_FFI_FILEFLAGSMASK
FILEOS VOS_NT_WINDOWS32
FILETYPE VFT_APP
FILESUBTYPE VFT2_UNKNOWN
{
BLOCK "StringFileInfo"
{
BLOCK "040904E4"
{
VALUE "CompanyName", "http://www.qemu.org"
VALUE "FileDescription", "QEMU machine emulators and tools"
VALUE "FileVersion", QEMU_VERSION
VALUE "LegalCopyright", "Copyright various authors. Released under the GNU General Public License."
VALUE "LegalTrademarks", "QEMU is a trademark of Fabrice Bellard."
VALUE "ProductName", "QEMU"
}
}
BLOCK "VarFileInfo"
{
VALUE "Translation", 0x0409, 1252
}
}

0 comments on commit 9fe6de9

Please sign in to comment.