[Spice-devel] [PATCHv2 win-agent 5/9] mingw: link with RC file to provide needed version information

Marc-André Lureau marcandre.lureau at gmail.com
Wed May 16 11:15:29 PDT 2012


---
 Makefile.am  |   38 +++++++++++++++++++++++++++-----------
 configure.ac |    1 +
 2 files changed, 28 insertions(+), 11 deletions(-)

diff --git a/Makefile.am b/Makefile.am
index 2e845ec..a2d2dae 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,10 +1,19 @@
+NULL =
+MAINTAINERCLEANFILES =
+
 INCLUDES =				\
 	-I$(top_srcdir)/common		\
-	$(SPICE_PROTOCOL_CFLAGS)
+	$(SPICE_PROTOCOL_CFLAGS)	\
+	$(NULL)
+
 AM_CPPFLAGS=-DUNICODE -D_UNICODE
+# -lversion is needed for the GetFileVersion* API which is used by vdlog.cpp
+LIBS = -lversion
 
 bin_PROGRAMS = vdagent vdservice
 
+vdagent_LDADD = $(CXIMAGE_LIBS) vdagent_rc.$(OBJEXT)
+vdagent_CXXFLAGS = $(CXIMAGE_CFLAGS)
 vdagent_SOURCES =			\
 	common/vdcommon.h		\
 	common/vdlog.cpp		\
@@ -13,27 +22,34 @@ vdagent_SOURCES =			\
 	vdagent/desktop_layout.h	\
 	vdagent/display_setting.cpp	\
 	vdagent/display_setting.h	\
-	vdagent/vdagent.cpp
+	vdagent/vdagent.cpp		\
+	$(NULL)
 
+vdagent_rc.$(OBJEXT): vdagent/vdagent.rc
+	$(AM_V_GEN)$(WINDRES) -i $< -o $@
+
+MAINTAINERCLEANFILES += vdagent_rc.$(OBJEXT)
+
+vdservice_LDADD = -lwtsapi32 vdservice_rc.$(OBJEXT)
 vdservice_SOURCES =			\
 	common/stdint.h			\
 	common/vdcommon.h		\
 	common/vdlog.cpp		\
 	common/vdlog.h			\
-	vdservice/vdservice.cpp		\
 	vdservice/pci_vdi_port.cpp	\
 	vdservice/pci_vdi_port.h	\
-	vdservice/vdi_port.h		\
 	vdservice/vdi_port.cpp		\
+	vdservice/vdi_port.h		\
+	vdservice/vdservice.cpp		\
+	vdservice/virtio_vdi_port.cpp	\
 	vdservice/virtio_vdi_port.h	\
-	vdservice/virtio_vdi_port.cpp
+	$(NULL)
+
+vdservice_rc.$(OBJEXT): vdservice/vdservice.rc
+	$(AM_V_GEN)$(WINDRES) -i $< -o $@
+
+MAINTAINERCLEANFILES += vdservice_rc.$(OBJEXT)
 
-# -lversion is needed for the GetFileVersion* API which is used by
-# vdlog.cpp
-LIBS = -lversion
-vdservice_LDADD = -lwtsapi32
-vdagent_LDADD = $(CXIMAGE_LIBS)
-vdagent_CXXFLAGS = $(CXIMAGE_CFLAGS)
 
 EXTRA_DIST =			\
 	tests/clipboard.py	\
diff --git a/configure.ac b/configure.ac
index 28c9d23..2888be3 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,6 +23,7 @@ AC_PROG_CC
 AC_PROG_CXX
 AM_PROG_CC_C_O
 AC_PROG_INSTALL
+AC_CHECK_TOOL(WINDRES, [windres])
 
 dnl ---------------------------------------------------------------------------
 dnl - Extra verbose warning switches
-- 
1.7.10.1



More information about the Spice-devel mailing list