Skip to contentSkip to conversation

version.rc patch

PATCH New C.W. Betts 1 participant 1 message Feb 10, 2008 Kbuild

lore
Share & tools
lore

C.W. Betts

author
#0 lore raw

PATCH 1/1 version.rc patch

First of all, I'd like to thank Johannes Schindelin for all the help and patience when dealing with a newbie like me.

This is a patch that will add version information to the Windows executable.
Index: Makefile.target
===================================================================
RCS file: /sources/qemu/qemu/Makefile.target,v
retrieving revision 1.245

Makefile.target 10 Feb 2008 18:08:44 -0000 renamed from Makefile.target 10 Feb 2008 16:33:12 -0000 1.245 +0 -0
diff -u -r1.245 Makefile.target
@@ -638,6 +638,7 @@
 

ifdef CONFIG_WIN32
SDL_LIBS := $(filter-out -mwindows, $(SDL_LIBS)) -mconsole +OBJS+=version.o
endif

# profiling code
@@ -654,6 +655,9 @@
%.o: %.c
 $(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<

+%.o: %.rc
+ windres -I. -DORIGINAL_FILENAME=\"$(QEMU_PROG)\" -c -o $< $@ +
%.o: %.S
$(CC) $(CPPFLAGS) -c -o $@ $<

Index: configure
===================================================================
RCS file: /sources/qemu/qemu/configure,v
retrieving revision 1.188

configure 10 Feb 2008 18:08:45 -0000 renamed from configure 10 Feb 2008 16:33:12 -0000 1.188 +0 -0
diff -u -r1.188 configure
@@ -1089,6 +1089,10 @@

echo "# Automatically generated by configure - do not modify" > $config_mak echo "/* Automatically generated by configure - do not modify */" > $config_h

+if test "$mingw32" = "yes" ; then
+echo "#define QEMU_FILEVERSION $(tr . , < VERSION),0" >> $config_h +echo "#define QEMU_PRODUCTVERSION $(tr . , < VERSION),0" >> $config_h +fi

echo "include ../config-host.mak" >> $config_mak
echo "#include \"../config-host.h\"" >> $config_h
Index: version.rc
===================================================================

version.rc Fri Feb 8 15:41:46 2008 renamed from dev/null Sun Feb 10 11:08:50 2008 +22 -0
diff -u /dev/null version.rc
@@ -0,0 +1,22 @@
+#include "config.h"
+
+1 VERSIONINFO
+FILEVERSION QEMU_FILEVERSION
+PRODUCTVERSION QEMU_PRODUCTVERSION
+FILETYPE 0x1 //VFT_APP
+ {
+BLOCK "StringFileInfo"
+  {
+  BLOCK "040904E4"
+  {
+   VALUE "FileDescription", "Qemu System emulator, " TARGET_ARCH " version"
+   VALUE "FileVersion", QEMU_VERSION
+   VALUE "LegalCopyright", "GNU General Public License"
+   VALUE "ProductName", "Qemu"
+  }
+ }
+BLOCK "VarFileInfo"
+ {
+  VALUE "Translation", 0x0409, 1252
+ }
+} 

Index: Makefile.target
===================================================================
RCS file: /sources/qemu/qemu/Makefile.target,v
retrieving revision 1.245

Makefile.target +4 -0
diff -u -r1.245 Makefile.target
@@ -638,6 +638,7 @@
 
 ifdef CONFIG_WIN32
 SDL_LIBS := $(filter-out -mwindows, $(SDL_LIBS)) -mconsole
+OBJS+=version.o
 endif
 
 # profiling code
@@ -654,6 +655,9 @@
 %.o: %.c
 	$(CC) $(CPPFLAGS) $(CFLAGS) -c -o $@ $<
 
+%.o: %.rc
+	windres -I. -DORIGINAL_FILENAME=\"$(QEMU_PROG)\" -c -o $< $@
+
 %.o: %.S
 	$(CC) $(CPPFLAGS) -c -o $@ $<
 

Index: configure
===================================================================
RCS file: /sources/qemu/qemu/configure,v
retrieving revision 1.188

configure +4 -0
diff -u -r1.188 configure
@@ -1089,6 +1089,10 @@
 echo "# Automatically generated by configure - do not modify" > $config_mak
 echo "/* Automatically generated by configure - do not modify */" > $config_h
 
+if test "$mingw32" = "yes" ; then
+echo "#define QEMU_FILEVERSION $(tr . , < VERSION),0" >> $config_h
+echo "#define QEMU_PRODUCTVERSION $(tr . , < VERSION),0" >> $config_h
+fi
 
 echo "include ../config-host.mak" >> $config_mak
 echo "#include \"../config-host.h\"" >> $config_h

Index: version.rc
===================================================================

version.rc new file +22 -0
diff -u /dev/null version.rc
@@ -0,0 +1,22 @@
+#include "config.h"
+
+1 VERSIONINFO
+FILEVERSION QEMU_FILEVERSION
+PRODUCTVERSION QEMU_PRODUCTVERSION
+FILETYPE 0x1 //VFT_APP
+ {
+BLOCK "StringFileInfo"
+  {
+  BLOCK "040904E4"
+  {
+   VALUE "FileDescription", "Qemu System emulator, " TARGET_ARCH " version"
+   VALUE "FileVersion", QEMU_VERSION
+   VALUE "LegalCopyright", "GNU General Public License"
+   VALUE "ProductName", "Qemu"
+  }
+ }
+BLOCK "VarFileInfo"
+ {
+  VALUE "Translation", 0x0409, 1252
+ }
+}