[libxml2] Add resource file to Windows DLL



commit d4049198707f7d7c344632a73119f847b6e5b217
Author: ccpaging <ccpaging gmail com>
Date:   Mon Nov 27 15:08:00 2017 +0100

    Add resource file to Windows DLL
    
    Add a resource file containing verison information for the Windows DLL.
    This is only used by the MSVC build for now.

 win32/Makefile.msvc |    7 +++++--
 win32/configure.js  |   12 ++++++++++++
 win32/libxml2.rc    |   36 ++++++++++++++++++++++++++++++++++++
 3 files changed, 53 insertions(+), 2 deletions(-)
---
diff --git a/win32/Makefile.msvc b/win32/Makefile.msvc
index ff8378e..38e7546 100644
--- a/win32/Makefile.msvc
+++ b/win32/Makefile.msvc
@@ -22,6 +22,7 @@ AUTOCONF = .\config.msvc
 XML_NAME = xml2
 XML_BASENAME = lib$(XML_NAME)
 XML_SO = $(XML_BASENAME).dll
+XML_RES = $(XML_BASENAME).res
 XML_IMP = $(XML_BASENAME).lib
 XML_DEF = $(XML_BASENAME).def
 XML_A = $(XML_BASENAME)_a.lib
@@ -367,11 +368,13 @@ $(XML_OBJS_A_DLL) : $(XML_INTDIR_A_DLL)
 # Creates the export definition file (DEF) for libxml.
 $(XML_INTDIR)\$(XML_DEF) : $(XML_INTDIR) $(XML_DEF).src
        $(CPP) $(CPPFLAGS) $(XML_DEF).src > $(XML_INTDIR)\$(XML_DEF)
+$(XML_INTDIR)\$(XML_RES) : $(XML_INTDIR) libxml2.rc
+       rc -Fo $(XML_INTDIR)\$(XML_RES) libxml2.rc
 
 # Creates the libxml shared object.
-$(BINDIR)\$(XML_SO) : $(BINDIR) $(XML_OBJS) $(XML_INTDIR)\$(XML_DEF)
+$(BINDIR)\$(XML_SO) : $(BINDIR) $(XML_OBJS) $(XML_INTDIR)\$(XML_DEF) $(XML_INTDIR)\$(XML_RES)
        $(LD) $(LDFLAGS) /DLL \
-               /IMPLIB:$(BINDIR)\$(XML_IMP) /OUT:$(BINDIR)\$(XML_SO) $(XML_OBJS) $(LIBS)
+               /IMPLIB:$(BINDIR)\$(XML_IMP) /OUT:$(BINDIR)\$(XML_SO) $(XML_OBJS) $(XML_INTDIR)\$(XML_RES) 
$(LIBS)
        @$(_VC_MANIFEST_EMBED_DLL)
 
 #$(BINDIR)\$(XML_SO) : $(BINDIR) $(XML_OBJS) $(XML_INTDIR)\$(XML_DEF)
diff --git a/win32/configure.js b/win32/configure.js
index 92b9ba0..dbf238c 100644
--- a/win32/configure.js
+++ b/win32/configure.js
@@ -280,6 +280,18 @@ function discoverVersion()
                vf.WriteLine("DYNRUNTIME=" + (dynruntime? "1" : "0"));
        }
        vf.Close();
+       versionFile = "rcVersion.h"
+       vf = fso.CreateTextFile(versionFile, true);
+       vf.WriteLine("/*");
+       vf.WriteLine("  " + versionFile);
+       vf.WriteLine("  This file is generated automatically by " + WScript.ScriptName + ".");
+       vf.WriteLine("*/");
+       vf.WriteBlankLines(1);
+       vf.WriteLine("#define LIBXML_MAJOR_VERSION " + verMajor);
+       vf.WriteLine("#define LIBXML_MINOR_VERSION " + verMinor);
+       vf.WriteLine("#define LIBXML_MICRO_VERSION " + verMicro);
+       vf.WriteLine("#define LIBXML_DOTTED_VERSION " + "\"" + verMajor + "." + verMinor + "." + verMicro + 
"\"");
+       vf.Close()
 }
 
 /* Configures libxml. This one will generate xmlversion.h from xmlversion.h.in
diff --git a/win32/libxml2.rc b/win32/libxml2.rc
new file mode 100644
index 0000000..c774a5e
--- /dev/null
+++ b/win32/libxml2.rc
@@ -0,0 +1,36 @@
+#include <winver.h>
+#include "rcVersion.h"
+
+VS_VERSION_INFO                VERSIONINFO
+  FILEVERSION          LIBXML_MAJOR_VERSION,LIBXML_MINOR_VERSION,LIBXML_MICRO_VERSION,0
+  PRODUCTVERSION       LIBXML_MAJOR_VERSION,LIBXML_MINOR_VERSION,LIBXML_MICRO_VERSION,0
+  FILEFLAGSMASK                VS_FFI_FILEFLAGSMASK
+#ifdef _DEBUG
+  FILEFLAGS            VS_FF_DEBUG
+#else
+  FILEFLAGS            0
+#endif
+  FILEOS               VOS__WINDOWS32
+  FILETYPE             VFT_DLL
+  FILESUBTYPE  VFT2_UNKNOWN    // not used
+BEGIN
+  BLOCK "StringFileInfo"
+  BEGIN
+    BLOCK "04090000"  /* Lang = US English, Charset = ASCII */
+    BEGIN
+      VALUE "FileDescription", "libxml2 library\0"
+      VALUE "FileVersion",     LIBXML_DOTTED_VERSION "\0"
+      VALUE "InternalName",    "libxml2.dll\0"
+      VALUE "LegalCopyright",  "Copyright (C) Daniel Veillard\0"
+      VALUE "LegalTrademarks", "\0"
+      VALUE "OriginalFilename",        "libxml2.dll\0"
+      VALUE "ProductName",     "libxml2\0"
+      VALUE "ProductVersion",  LIBXML_DOTTED_VERSION "\0"
+      VALUE "Comments",                "For more information visit http://xmlsoft.org/\0";
+    END
+  END
+  BLOCK "VarFileInfo"
+  BEGIN
+      VALUE "Translation", 0x0409, 0  /* US English, ASCII */
+  END
+END


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]