Skip to contentSkip to conversation

Windows: put version and file info into exe

PATCH In review C.W. Betts 2 participants 2 messages Feb 7, 2008 – Feb 8, 2008 Kbuild

lore
Share & tools
lore

C.W. Betts

author
#0 lore raw

PATCH 1/1 Windows: put version and file info into exe

This patch will make an .rc file that will put the version info as well as a brief discription of the app for Windows.

? bxversion.rc
? qemuversion.rc.in
? versionrc.diff
Index: Makefile.target
===================================================================
RCS file: /sources/qemu/qemu/Makefile.target,v
retrieving revision 1.244

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

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

configure +41 -2

83 lines not on this page · raw message

#1 lore raw

Hi,

Quoted 2 lines · C.W. Betts

This patch will make an .rc file that will put the version info as well as a brief discription of the app for Windows.

It would have been easier to comment on the patch if you would have inlined it.

configure 7 Feb 2008 18:11:27 -0000

Quoted 12 lines

diff -u -r1.187 configure

configure 7 Feb 2008 18:11:27 -0000 renamed from configure 3 Feb 2008 19:20:13 -0000 1.187 +0 -0
@@ -677,7 +677,7 @@
 

if test "$mingw32" = "yes" ; then
if test -z "$prefix" ; then

configure 7 Feb 2008 18:11:27 -0000 renamed from configure 3 Feb 2008 19:20:13 -0000 1.187 +1 -1
-      prefix="/c/Program Files/Qemu"
+      prefix=/c/Program\ Files/Qemu
  fi
  mansuffix=""
  datasuffix=""

Why not go the full nine yards and use $PROGRAMFILES, being nice to non-English users? Besides, how is this change related to your subject? Is it even necessary?

Quoted 2 lines

+echo " VALUE \"LegalCopyright\", \"GNU Lesser General Public
License\"" >> $version_rc

This is actively wrong: LICENSE states

1) QEMU as a whole is released under the GNU General Public License

Quoted 1 line

+#echo " VALUE \"ProductVersion\", \"@REL_STRING@\"" > $version_rc

You don't want that to be committed.

Overall: would it not be nicer to have the version.rc file tracked, instead of written by configure? You'd only need to add a #define for the WINDOWS_VERSION (a la QEMU_VERSION) in config-host.h. Then use it in version.rc. TARGET_ARCH is already #defined in $target/config.h, and for the OriginalFilename, you could change the Makefile rule from

+
+%.o: %.rc
+ windres -c -o $< $@

to

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

Hth,
Dscho