[Spice-devel] [spice-xpi 1/5] mingw: Add support for mingw build
Christophe Fergeau
cfergeau at redhat.com
Sun Mar 24 04:16:25 PDT 2013
Based on a patch from Nerijus Baliunas <nerijus at users.sourceforge.net>
---
SpiceXPI/src/plugin/Makefile.am | 23 ++++++++++++++++++++---
SpiceXPI/src/plugin/resource.rc | 34 ++++++++++++++++++++++++++++++++++
configure.ac | 19 ++++++++++++++++++-
3 files changed, 72 insertions(+), 4 deletions(-)
create mode 100644 SpiceXPI/src/plugin/resource.rc
diff --git a/SpiceXPI/src/plugin/Makefile.am b/SpiceXPI/src/plugin/Makefile.am
index 2db218e..9116ba7 100644
--- a/SpiceXPI/src/plugin/Makefile.am
+++ b/SpiceXPI/src/plugin/Makefile.am
@@ -8,7 +8,7 @@ plugindir=$(extensiondir)/plugins
plugin_LTLIBRARIES = libnsISpicec.la
-libnsISpicec_la_LDFLAGS = -avoid-version -module
+libnsISpicec_la_LDFLAGS = -avoid-version -module -no-undefined
libnsISpicec_la_CPPFLAGS = \
-I$(top_srcdir)/common \
-I$(srcdir)/npapi \
@@ -28,8 +28,6 @@ libnsISpicec_la_SOURCES = \
glib-compat.h \
controller.cpp \
controller.h \
- controller-unix.cpp \
- controller-unix.h \
npapi/npapi.h \
npapi/npfunctions.h \
npapi/npruntime.h \
@@ -49,6 +47,25 @@ libnsISpicec_la_SOURCES = \
pluginbase.h \
$(NULL)
+if OS_LINUX
+libnsISpicec_la_SOURCES += \
+ controller-unix.cpp \
+ controller-unix.h \
+ $(NULL)
+endif
+
+if OS_WINDOWS
+.rc.lo:
+ $(LIBTOOL) --tag=RC $(AM_LIBTOOLFLAGS) $(LIBTOOLFLAGS) --mode=compile $(WINDRES) $(RCFLAGS) -i $< -o $@
+
+libnsISpicec_la_SOURCES += \
+ resource.rc \
+ $(NULL)
+
+.rc.$(OBJEXT):
+ $(AM_V_GEN)$(WINDRES) $(RCFLAGS) -i $< -o $@
+endif
+
if BUILD_XPI
libnsISpicec_la_SOURCES += \
nsISpicec.h \
diff --git a/SpiceXPI/src/plugin/resource.rc b/SpiceXPI/src/plugin/resource.rc
new file mode 100644
index 0000000..8892b0a
--- /dev/null
+++ b/SpiceXPI/src/plugin/resource.rc
@@ -0,0 +1,34 @@
+1 VERSIONINFO
+ FILEVERSION 2,8,0,0
+ PRODUCTVERSION 2,8,0,0
+ FILEFLAGSMASK 0x17L
+#ifdef _DEBUG
+ FILEFLAGS 0x1L
+#else
+ FILEFLAGS 0x0L
+#endif
+ FILEOS 0x4L
+ FILETYPE 0x1L
+ FILESUBTYPE 0x0L
+BEGIN
+ BLOCK "StringFileInfo"
+ BEGIN
+ BLOCK "040904E4"
+ BEGIN
+ VALUE "CompanyName", "Fedora"
+ VALUE "FileDescription", "Spice XPI Plugin"
+ VALUE "FileVersion", "2, 8, 0, 0"
+ VALUE "InternalName", "SpiceXPI"
+ VALUE "LegalCopyright", "Fedora"
+ VALUE "OriginalFilename", "nsISpicec.dll"
+ VALUE "ProductName", "Spice XPI"
+ VALUE "ProductVersion", "2, 8, 0, 0"
+ VALUE "MIMEType", "application/x-spice"
+ VALUE "FileExtents", "qsc"
+ END
+ END
+ BLOCK "VarFileInfo"
+ BEGIN
+ VALUE "Translation", 0x809, 1200
+ END
+END
diff --git a/configure.ac b/configure.ac
index 3ed0cfc..7f401ab 100644
--- a/configure.ac
+++ b/configure.ac
@@ -13,9 +13,26 @@ AC_PROG_CXX
AC_PROG_INSTALL
AC_CANONICAL_HOST
AC_PROG_LIBTOOL
+LT_LANG([Windows Resource])
AM_PROG_CC_C_O
-AC_DEFINE([XP_UNIX], 1, [Building Linux plugin])
+AC_MSG_CHECKING([operating system])
+case $host in
+*-linux*)
+ AC_MSG_RESULT([Linux])
+ backend="linux"
+ AC_DEFINE([XP_UNIX], 1, [Building Linux plugin])
+ ;;
+*-mingw*)
+ AC_MSG_RESULT([Windows])
+ backend="windows"
+ AC_CHECK_TOOL([WINDRES], [windres], [no])
+ AC_DEFINE([XP_WIN], 1, [Building Windows plugin])
+ ;;
+esac
+
+AM_CONDITIONAL([OS_LINUX], [test "x$backend" = xlinux])
+AM_CONDITIONAL([OS_WINDOWS], [test "x$backend" = xwindows])
dnl =========================================================================
dnl Check deps
--
1.8.1.4
More information about the Spice-devel
mailing list