Skip to contentSkip to conversation

makefile: fix w32 install target for qemu-ga

PATCH In review Michael Roth 2 participants 3 messages Nov 15, 2015 – Nov 17, 2015 Kbuild

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 makefile: fix w32 install target for qemu-ga

fafcaf1 added a 'qemu-ga' install target on w32, which can be used in place of the existing qemu-ga.exe target to also handle dealing with other components such as DLLs for VSS/fsfreeze and generating an MSI package if appropriate configure options are present.

As part of that, qemu-ga$(EXESUF) was removed from $TOOLS in favor of this new qemu-ga target.

The install rule however relies on a direct mapping of the $TOOLS entry to the actual resulting binary. In the case of w32, qemu-ga is not identical to qemu-ga$(EXESUF), and the install recipe fails to find the 'qemu-ga' binary.

Fix this by essentially remapping 'qemu-ga' back to 'qemu-ga.exe' in the install recipe.

This raises the question of whether or not qemu-ga should continue to live in TOOLS as opposed to it's own special target, but as a late fix for a regression in 2.5 this commit should be safer, since we rely on qemu-ga's presence in $TOOLS in several places throughout Makefile.

---
 Makefile | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
Makefile +5 -1
index fc1f8bb..8acda9e 100644
@@ -440,7 +440,11 @@ endif
 install: all $(if $(BUILD_DOCS),install-doc) \
 install-datadir install-localstatedir
 ifneq ($(TOOLS),)
-	$(call install-prog,$(TOOLS),$(DESTDIR)$(bindir))
+	$(call install-prog,$(filter-out qemu-ga,$(TOOLS)),$(DESTDIR)$(bindir))
+	# qemu-ga is included in TOOLS, but we need special install rules for w32
+ifneq (,$(findstring qemu-ga,$(TOOLS)))
+	$(call install-prog,qemu-ga$(EXESUF),$(DESTDIR)$(bindir))
+endif
 endif
 ifneq ($(CONFIG_MODULES),)
 	$(INSTALL_DIR) "$(DESTDIR)$(qemu_moddir)"
Signature · 1 line
1.9.1
Reviewed-by on v1 1/1
#1 lore raw

This mail arrived with one day delay (obviously caused by the mailing list server). Please see my comments below.

Am 15.11.2015 um 17:12 schrieb Michael Roth:

Quoted 13 lines

fafcaf1 added a 'qemu-ga' install target on w32, which can be used in place of the existing qemu-ga.exe target to also handle dealing with other components such as DLLs for VSS/fsfreeze and generating an MSI package if appropriate configure options are present.

As part of that, qemu-ga$(EXESUF) was removed from $TOOLS in favor of this new qemu-ga target.

The install rule however relies on a direct mapping of the $TOOLS entry to the actual resulting binary. In the case of w32, qemu-ga is not identical to qemu-ga$(EXESUF), and the install recipe fails to find the 'qemu-ga' binary.

Quoted 5 lines

Fix this by essentially remapping 'qemu-ga' back to 'qemu-ga.exe' in the install recipe.

This raises the question of whether or not qemu-ga should continue to live in TOOLS as opposed to it's own special target, but as a

its?

Quoted 18 lines

late fix for a regression in 2.5 this commit should be safer, since we rely on qemu-ga's presence in $TOOLS in several places throughout Makefile.

---
 Makefile | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
Makefile +0 -0
index fc1f8bb..8acda9e 100644
@@ -440,7 +440,11 @@ endif
 install: all $(if $(BUILD_DOCS),install-doc) \
 install-datadir install-localstatedir

Makefile endif · line 450

Quoted 10 lines
Makefile +5 -1
 ifneq ($(TOOLS),)
-	$(call install-prog,$(TOOLS),$(DESTDIR)$(bindir))
+	$(call install-prog,$(filter-out qemu-ga,$(TOOLS)),$(DESTDIR)$(bindir))
+	# qemu-ga is included in TOOLS, but we need special install rules for w32
+ifneq (,$(findstring qemu-ga,$(TOOLS)))
+	$(call install-prog,qemu-ga$(EXESUF),$(DESTDIR)$(bindir))
+endif
 endif
 ifneq ($(CONFIG_MODULES),)
 	$(INSTALL_DIR) "$(DESTDIR)$(qemu_moddir)"

The patch is not pretty at all, but it works for 2.5.

We should improve this and also some redundant dependencies like this one later:

$(QEMU_GA_MSI): qemu-ga.exe $(QGA_VSS_PROVIDER)
qemu-ga: qemu-ga$(EXESUF) $(QGA_VSS_PROVIDER) $(QEMU_GA_MSI)

Thanks,
Stefan

#2 lore raw

Quoting Stefan Weil (2015-11-16 16:03:49)

Quoted 56 lines

This mail arrived with one day delay (obviously caused by the mailing list server). Please see my comments below.

Am 15.11.2015 um 17:12 schrieb Michael Roth:

Quoted 13 lines

fafcaf1 added a 'qemu-ga' install target on w32, which can be used in place of the existing qemu-ga.exe target to also handle dealing with other components such as DLLs for VSS/fsfreeze and generating an MSI package if appropriate configure options are present.

As part of that, qemu-ga$(EXESUF) was removed from $TOOLS in favor of this new qemu-ga target.

The install rule however relies on a direct mapping of the $TOOLS entry to the actual resulting binary. In the case of w32, qemu-ga is not identical to qemu-ga$(EXESUF), and the install recipe fails to find the 'qemu-ga' binary.

Quoted 5 lines

Fix this by essentially remapping 'qemu-ga' back to 'qemu-ga.exe' in the install recipe.

This raises the question of whether or not qemu-ga should continue to live in TOOLS as opposed to it's own special target, but as a

its?

Quoted 18 lines

late fix for a regression in 2.5 this commit should be safer, since we rely on qemu-ga's presence in $TOOLS in several places throughout Makefile.

---
 Makefile | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)
Makefile +0 -0
index fc1f8bb..8acda9e 100644
@@ -440,7 +440,11 @@ endif
 install: all $(if $(BUILD_DOCS),install-doc) \
 install-datadir install-localstatedir

Makefile endif · line 450

Quoted 10 lines
Makefile +5 -1
 ifneq ($(TOOLS),)
-     $(call install-prog,$(TOOLS),$(DESTDIR)$(bindir))
+     $(call install-prog,$(filter-out qemu-ga,$(TOOLS)),$(DESTDIR)$(bindir))
+     # qemu-ga is included in TOOLS, but we need special install rules for w32
+ifneq (,$(findstring qemu-ga,$(TOOLS)))
+     $(call install-prog,qemu-ga$(EXESUF),$(DESTDIR)$(bindir))
+endif
 endif
 ifneq ($(CONFIG_MODULES),)
      $(INSTALL_DIR) "$(DESTDIR)$(qemu_moddir)"
Quoted 7 lines

The patch is not pretty at all, but it works for 2.5.

We should improve this and also some redundant dependencies like this one later:

$(QEMU_GA_MSI): qemu-ga.exe $(QGA_VSS_PROVIDER)
qemu-ga: qemu-ga$(EXESUF) $(QGA_VSS_PROVIDER) $(QEMU_GA_MSI)

Agreed. Will look at this as part of cleaning up the TOOLS hacks.

Thanks for the review, applied to qga tree with commit msg fixup:

https://github.com/mdroth/qemu/commits/qga

Quoted 5 lines

Thanks,
Stefan