The following components use Windows driver information:
-       System (inf file); used during device installation
-       Resource file (rc file); used by applications when looking over the 
driver
    file(sys)

Currently we have the following for the driver version number:
-       (inf file) generated value from the build timestamp
-       (rc file) predefined value

This patch forces both files to depend on a variable: '$(Version)'.
This is a predefined variable from Visual Studio.

To achieve the above we change the current project settings used by the
'stampinf' utility and we define a new preprocessor value named
'VersionWithCommas' (which is obtained by replacing all
'.' with ',' from $(Version) ).
Certain values from the resource file are expected to use ',' instead of '.' .

The resource file has been updated to use the new values when generating
information about the driver (sys).

The variable '$(Version' can be changed from the command line via the
'msbuild' utility.

Signed-off-by: Alin Gabriel Serdean <[email protected]>
---
 datapath-windows/ovsext/ovsext.rc      | 11 ++++++-----
 datapath-windows/ovsext/ovsext.vcxproj | 19 ++++++++++++++++++-
 2 files changed, 24 insertions(+), 6 deletions(-)

diff --git a/datapath-windows/ovsext/ovsext.rc 
b/datapath-windows/ovsext/ovsext.rc
index 0b92e2e..578367d 100644
--- a/datapath-windows/ovsext/ovsext.rc
+++ b/datapath-windows/ovsext/ovsext.rc
@@ -8,14 +8,15 @@
 LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_US
 #pragma code_page(1252)
 
+#define STR(x)                          #x
 /////////////////////////////////////////////////////////////////////////////
 //
 // Version
 //
 
 VS_VERSION_INFO VERSIONINFO
- FILEVERSION 6,3,9600,17298
- PRODUCTVERSION 6,3,9600,17298
+ FILEVERSION VersionWithCommas
+ PRODUCTVERSION VersionWithCommas
  FILEFLAGSMASK 0x3fL
 #ifdef _DEBUG
  FILEFLAGS 0x9L
@@ -32,12 +33,12 @@ BEGIN
         BEGIN
             VALUE "CompanyName", "Open vSwitch"
             VALUE "FileDescription", "Open vSwitch Extension"
-            VALUE "FileVersion", "6.3.9600.17298"
+            VALUE "FileVersion", STR(Version)
             VALUE "InternalName", "OVSExt.SYS"
             VALUE "LegalCopyright", "Licensed under the Apache License, 
Version 2.0 (the ""License"")"
             VALUE "OriginalFilename", "OVSExt.SYS"
-            VALUE "ProductName", "Open vSwitch 8/8.1 DDK driver"
-            VALUE "ProductVersion", "6.3.9600.17298"
+            VALUE "ProductName", "Open vSwitch"
+            VALUE "ProductVersion", STR(Version)
         END
     END
     BLOCK "VarFileInfo"
diff --git a/datapath-windows/ovsext/ovsext.vcxproj 
b/datapath-windows/ovsext/ovsext.vcxproj
index 77530fd..dc0d2db 100644
--- a/datapath-windows/ovsext/ovsext.vcxproj
+++ b/datapath-windows/ovsext/ovsext.vcxproj
@@ -174,6 +174,18 @@
       <MultiProcessorCompilation 
Condition="'$(Configuration)|$(Platform)'=='Win8.1 
Debug|x64'">true</MultiProcessorCompilation>
       <MultiProcessorCompilation 
Condition="'$(Configuration)|$(Platform)'=='Win8.1 
Release|x64'">true</MultiProcessorCompilation>
     </ClCompile>
+    <Inf>
+      <TimeStamp Condition="'$(Configuration)|$(Platform)'=='Win8 
Debug|x64'">$(Version)</TimeStamp>
+    </Inf>
+    <Inf>
+      <TimeStamp Condition="'$(Configuration)|$(Platform)'=='Win8.1 
Debug|x64'">$(Version)</TimeStamp>
+    </Inf>
+    <Inf>
+      <TimeStamp Condition="'$(Configuration)|$(Platform)'=='Win8 
Release|x64'">$(Version)</TimeStamp>
+    </Inf>
+    <Inf>
+      <TimeStamp Condition="'$(Configuration)|$(Platform)'=='Win8.1 
Release|x64'">$(Version)</TimeStamp>
+    </Inf>
   </ItemDefinitionGroup>
   <ItemGroup>
     <ClCompile Include="Actions.c" />
@@ -212,7 +224,12 @@
     <ClCompile Include="Util.c" />
     <ClCompile Include="Vport.c" />
     <ClCompile Include="Vxlan.c" />
-    <ResourceCompile Include="ovsext.rc" />
+    <ResourceCompile Include="ovsext.rc">
+      <PreprocessorDefinitions 
Condition="'$(Configuration)|$(Platform)'=='Win8 
Release|x64'">%(PreprocessorDefinitions);NDIS_WDM=1;NDIS630=1;VersionWithCommas=$(Version.Replace('.',','))</PreprocessorDefinitions>
+      <PreprocessorDefinitions 
Condition="'$(Configuration)|$(Platform)'=='Win8 
Debug|x64'">%(PreprocessorDefinitions);NDIS_WDM=1;NDIS630=1;VersionWithCommas=$(Version.Replace('.',','))</PreprocessorDefinitions>
+      <PreprocessorDefinitions 
Condition="'$(Configuration)|$(Platform)'=='Win8.1 
Release|x64'">%(PreprocessorDefinitions);NDIS_WDM=1;NDIS640=1;VersionWithCommas=$(Version.Replace('.',','))</PreprocessorDefinitions>
+      <PreprocessorDefinitions 
Condition="'$(Configuration)|$(Platform)'=='Win8.1 
Debug|x64'">%(PreprocessorDefinitions);NDIS_WDM=1;NDIS640=1;VersionWithCommas=$(Version.Replace('.',','))</PreprocessorDefinitions>
+    </ResourceCompile>
   </ItemGroup>
   <ItemGroup>
     <Inf Exclude="@(Inf)" Include="*.inf" />
-- 
2.10.2.windows.1
_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to