From patchwork Sun Sep 19 08:42:42 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Blue Swirl X-Patchwork-Id: 65151 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 125D9B70D2 for ; Sun, 19 Sep 2010 18:43:57 +1000 (EST) Received: from localhost ([127.0.0.1]:55440 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OxFV3-0006e9-Px for incoming@patchwork.ozlabs.org; Sun, 19 Sep 2010 04:43:53 -0400 Received: from [140.186.70.92] (port=54822 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OxFUG-0006Zr-Fo for qemu-devel@nongnu.org; Sun, 19 Sep 2010 04:43:05 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OxFUF-0003YT-3m for qemu-devel@nongnu.org; Sun, 19 Sep 2010 04:43:04 -0400 Received: from mail-qy0-f173.google.com ([209.85.216.173]:47100) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OxFUF-0003YD-0o for qemu-devel@nongnu.org; Sun, 19 Sep 2010 04:43:03 -0400 Received: by qyk34 with SMTP id 34so2128513qyk.4 for ; Sun, 19 Sep 2010 01:43:02 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:received:mime-version:received:from:date :message-id:subject:to:cc:content-type; bh=wITxK6W3XlB3JGNVEhnMkN4bUd6COE0x3LL2uwGsQFU=; b=b/v9EbrvaSbvNn0v7e6dmeDnpRatUUDUxmv+KDaaD2Tx8SurGRS5nBUusXDpQW/qLY mnhcezUYDFRzfwQtzlDz8iWvChwHDkFQPVlgclNm0pwq/v3NPIinE52Gf1xZD4AaWAj/ kxMYn4YE3/nmqmZSZygwUHQ4Td5xeiIr+6zB8= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:from:date:message-id:subject:to:cc:content-type; b=AqxhDRFioP+oI7cpjyX3W7VNlcQ0rAR8RG8IiD0zKGtgh6RDfxbT5NfBSbPAH3ObqX vC3DFKgsjz74OEV+Sq2iitwbhlH0l6zXQzOAmarGVlf6/yhshmRDWIMtIp7zvqfxagaJ M5DT10dpqtP6bgqlN7OvMnsSZV0VX+0TY38cs= Received: by 10.224.60.137 with SMTP id p9mr4874599qah.145.1284885782150; Sun, 19 Sep 2010 01:43:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.229.236.66 with HTTP; Sun, 19 Sep 2010 01:42:42 -0700 (PDT) From: Blue Swirl Date: Sun, 19 Sep 2010 08:42:42 +0000 Message-ID: To: qemu-devel X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) Cc: rr@bttr-software.de, "C.W. Betts" Subject: [Qemu-devel] [PATCH] mingw: add version information to the executables X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Add QEMU version information to the executables, based on earlier work by C. W. Betts and Robert Riebisch. Signed-off-by: Blue Swirl --- Makefile | 10 +++++++--- Makefile.objs | 1 + configure | 12 ++++++++++++ version.rc | 28 ++++++++++++++++++++++++++++ 4 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 version.rc +} diff --git a/Makefile b/Makefile index ab91d42..732858b 100644 --- a/Makefile +++ b/Makefile @@ -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 $@") diff --git a/Makefile.objs b/Makefile.objs index 3ef6d80..bf32f8a 100644 --- a/Makefile.objs +++ b/Makefile.objs @@ -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 diff --git a/configure b/configure index 3bfc5e9..18db3df 100755 --- a/configure +++ b/configure @@ -81,6 +81,7 @@ install="install" objcopy="objcopy" ld="ld" strip="strip" +windres="windres" helper_cflags="" libs_softmmu="" libs_tools="" @@ -127,6 +128,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" @@ -2290,6 +2292,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 @@ -2530,6 +2541,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 diff --git a/version.rc b/version.rc new file mode 100644 index 0000000..82e10ec --- /dev/null +++ b/version.rc @@ -0,0 +1,28 @@ +#include +#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 + }