[PATCH 1/2] Windows version numbers


Ian Bell <IBell@...>
 

From 9824947a63179e8040e4198dfd8bad5b37b84fa6 Mon Sep 17 00:00:00 2001

Message-Id: <9824947a63179e8040e4198dfd8bad5b37b84fa6.1351154127.git.ibell@...>

From: Ian Bell <ibell@...>

Date: Thu, 25 Oct 2012 09:29:58 +0100

Subject: [PATCH 1/2] Windows version numbers

 

Added a script to generate the version headers for mamac dll.

Also fixed the resource files to use these headers.

---

mama/c_cpp/src/c/generateMamaVersion.bat |   28 +++++++++++++++++

mama/c_cpp/src/c/mamac.vcproj            |    6 +++-

mama/c_cpp/src/c/version.rc              |   24 +++++++--------

mama/c_cpp/src/cpp/mamacpp.vcproj        |    4 +++

mama/c_cpp/src/cpp/version.rc            |   48 +++++++-----------------------

5 files changed, 58 insertions(+), 52 deletions(-)

 

diff --git a/mama/c_cpp/src/c/generateMamaVersion.bat b/mama/c_cpp/src/c/generateMamaVersion.bat

new file mode 100644

index 0000000..795b65a

--- /dev/null

+++ b/mama/c_cpp/src/c/generateMamaVersion.bat

@@ -0,0 +1,28 @@

+set BUILD_DIR=%1

+set VERSION_MAJOR=1

+set VERSION_MINOR=0

+set VERSION_RELEASE=0

+set RC_VERSION_NUMERICAL=1

+set RC_VERSION_STRING=1

+set MAMACDLL=libmamacmdd.dll

+set MAMACPPDLL=libmamacppmdd.dll

+

+echo "generating version files.." 

+

+echo /* This file was automatically generated */ > %BUILD_DIR%\mama\version.h

+echo #ifndef MamaVersionH >> %BUILD_DIR%\mama\version.h

+echo #define MamaVersionH >> %BUILD_DIR%\mama\version.h

+echo #define MAMA_VERSION_MAJOR %VERSION_MAJOR% >> %BUILD_DIR%\mama\version.h

+echo #define MAMA_VERSION_MINOR %VERSION_MINOR% >> %BUILD_DIR%\mama\version.h

+echo #define MAMA_VERSION_RELEASE %VERSION_RELEASE% >> %BUILD_DIR%\mama\version.h

+echo #define MAMA_VERSION "mama %VERSION_MAJOR%.%VERSION_MINOR%.%VERSION_RELEASE%" >> %BUILD_DIR%\mama\version.h  

+echo #define RC_VERSION_NUMERICAL %RC_VERSION_NUMERICAL% >> %BUILD_DIR%\mama\version.h

+echo #define RC_VERSION_STRING "%RC_VERSION_STRING%" >> %BUILD_DIR%\mama\version.h

+echo #define RC_C_DLL_NAME "%MAMACDLL%" >> %BUILD_DIR%\mama\version.h

+echo #define RC_CPP_DLL_NAME "%MAMACPPDLL%" >> %BUILD_DIR%\mama\version.h

+echo extern const char* mama_version; >> %BUILD_DIR%\mama\version.h

+echo #endif >> %BUILD_DIR%\mama\version.h

+echo /* This file was automatically generated */ > %BUILD_DIR%\version.c

+echo const char* mama_version = "mama %VERSION_MAJOR%.%VERSION_MINOR%.%VERSION_RELEASE%"; >> %BUILD_DIR%\version.c

+

+echo "complete"

diff --git a/mama/c_cpp/src/c/mamac.vcproj b/mama/c_cpp/src/c/mamac.vcproj

index 7ebab7f..0fc2edb 100644

--- a/mama/c_cpp/src/c/mamac.vcproj

+++ b/mama/c_cpp/src/c/mamac.vcproj

@@ -27,7 +27,7 @@

                                               >

                                               <Tool

                                                               Name="VCPreBuildEventTool"

-                                                              CommandLine=""

+                                                             CommandLine="$(InputDir)\generateMamaVersion.bat $(InputDir)"

                                               />

                                               <Tool

                                                               Name="VCCustomBuildTool"

@@ -43,6 +43,7 @@

                                               />

                                               <Tool

                                                               Name="VCCLCompilerTool"

+                                                             AdditionalOptions="/D &quot;_CRTDBG_MAP_ALLOC&quot; /FI &quot;stdlib.h&quot; /FI &quot;crtdbg.h&quot; "

                                                               Optimization="0"

                                                               AdditionalIncludeDirectories="&quot;$(SOLUTIONDIR)\common\c_cpp\src\c\windows&quot;;&quot;$(SOLUTIONDIR)\common\c_cpp\src\c&quot;;&quot;$(SOLUTIONDIR)\mama\c_cpp\src\c&quot;"

                                                               PreprocessorDefinitions="WIN32;_DEBUG;_WINDOWS;_USRDLL;MAMA_DLL;_USE_32BIT_TIME_T;MAMA;FD_SETSIZE=1024"

@@ -60,6 +61,7 @@

                                               />

                                               <Tool

                                                               Name="VCResourceCompilerTool"

+                                                             AdditionalIncludeDirectories="&quot;$(SOLUTIONDIR)\mama\c_cpp\src\c&quot;"

                                               />

                                               <Tool

                                                               Name="VCPreLinkEventTool"

@@ -108,6 +110,7 @@

                                               >

                                               <Tool

                                                               Name="VCPreBuildEventTool"

+                                                             CommandLine="$(InputDir)\generateMamaVersion.bat $(InputDir)"

                                               />

                                               <Tool

                                                               Name="VCCustomBuildTool"

@@ -137,6 +140,7 @@

                                               />

                                               <Tool

                                                               Name="VCResourceCompilerTool"

+                                                             AdditionalIncludeDirectories="&quot;$(SOLUTIONDIR)\mama\c_cpp\src\c&quot;"

                                               />

                                               <Tool

                                                               Name="VCPreLinkEventTool"

diff --git a/mama/c_cpp/src/c/version.rc b/mama/c_cpp/src/c/version.rc

index b2b08fa..09197f2 100644

--- a/mama/c_cpp/src/c/version.rc

+++ b/mama/c_cpp/src/c/version.rc

@@ -1,7 +1,5 @@

-// Microsoft Visual C++ generated resource script.

-//

-#include "resource.h"

+#include "mama/version.h"

#define APSTUDIO_READONLY_SYMBOLS

/////////////////////////////////////////////////////////////////////////////

//

@@ -27,18 +25,18 @@ LANGUAGE LANG_ENGLISH, SUBLANG_ENGLISH_UK

// TEXTINCLUDE

//

-1 TEXTINCLUDE

+1 TEXTINCLUDE DISCARDABLE

 BEGIN

     "resource.h\0"

END

-2 TEXTINCLUDE

+2 TEXTINCLUDE DISCARDABLE

 BEGIN

     "#include ""afxres.h""\r\n"

     "\0"

END

-3 TEXTINCLUDE

+3 TEXTINCLUDE DISCARDABLE

 BEGIN

     "\r\n"

     "\0"

@@ -53,8 +51,8 @@ END

//

 VS_VERSION_INFO VERSIONINFO

- FILEVERSION 6,0,0,15

- PRODUCTVERSION 6,0,0,15

+ FILEVERSION RC_VERSION_NUMERICAL

+ PRODUCTVERSION RC_VERSION_NUMERICAL

  FILEFLAGSMASK 0x3fL

#ifdef _DEBUG

  FILEFLAGS 0x1L

@@ -71,12 +69,12 @@ BEGIN

         BEGIN

             VALUE "CompanyName", "NYSE Technologies"

             VALUE "FileDescription", "MAMA API C"

-            VALUE "FileVersion", "6.0.0.15"

-            VALUE "InternalName", "MAMA"

-            VALUE "LegalCopyright", "Copyright © 2009 NYSE Technologies"

-            VALUE "OriginalFilename", "MAMAC"

+            VALUE "FileVersion", RC_VERSION_STRING

+            VALUE "InternalName", "MAMAC"

+            VALUE "LegalCopyright", "Copyright © 2012 NYSE Technologies"

+            VALUE "OriginalFilename", RC_C_DLL_NAME

             VALUE "ProductName", "NYSE Technologies MAMA"

-            VALUE "ProductVersion", "6.0.0.15"

+            VALUE "ProductVersion", RC_VERSION_STRING

         END

     END

     BLOCK "VarFileInfo"

diff --git a/mama/c_cpp/src/cpp/mamacpp.vcproj b/mama/c_cpp/src/cpp/mamacpp.vcproj

index fb469c2..9c78a84 100644

--- a/mama/c_cpp/src/cpp/mamacpp.vcproj

+++ b/mama/c_cpp/src/cpp/mamacpp.vcproj

@@ -61,6 +61,7 @@

                                               />

                                               <Tool

                                                               Name="VCResourceCompilerTool"

+                                                             AdditionalIncludeDirectories="&quot;$(SOLUTIONDIR)\mama\c_cpp\src\c&quot;"

                                               />

                                               <Tool

                                                               Name="VCPreLinkEventTool"

@@ -142,6 +143,7 @@

                                               />

                                               <Tool

                                                               Name="VCResourceCompilerTool"

+                                                             AdditionalIncludeDirectories="&quot;$(SOLUTIONDIR)\mama\c_cpp\src\c&quot;"

                                               />

                                               <Tool

                                                               Name="VCPreLinkEventTool"

@@ -216,6 +218,7 @@

                                               />

                                               <Tool

                                                               Name="VCResourceCompilerTool"

+                                                             AdditionalIncludeDirectories="&quot;$(SOLUTIONDIR)\mama\c_cpp\src\c&quot;"

                                               />

                                               <Tool

                                                               Name="VCPreLinkEventTool"

@@ -293,6 +296,7 @@

                                               />

                                               <Tool

                                                               Name="VCResourceCompilerTool"

+                                                             AdditionalIncludeDirectories="&quot;$(SOLUTIONDIR)\mama\c_cpp\src\c&quot;"

                                               />

                                               <Tool

                                                               Name="VCPreLinkEventTool"

diff --git a/mama/c_cpp/src/cpp/version.rc b/mama/c_cpp/src/cpp/version.rc

index 8e8d204..a9eb6c2 100644

--- a/mama/c_cpp/src/cpp/version.rc

+++ b/mama/c_cpp/src/cpp/version.rc

@@ -1,21 +1,4 @@

-/**

- * 'winhtl.exe' version resource script.

- *

- * Note, this was copied from the resource script

- * generated by the VC6 project for

- * /projects/gma-agent/source/generic/winhtl/source.

- *

- * Modifications made:

- *  o remove dependency on "resource.h"

- *

- * @author  Martin Downey

- * @version $Revision$

- *          $Date$

- */

- /* This version.h file is created dynamically by the build script and contains definitions for the library name and

-  * version numbers that are required for the VERSIONINFO resource included in this file. 

-  */

-#include "version.h"

+#include "mama/version.h"

#define APSTUDIO_READONLY_SYMBOLS

#include "afxres.h"

#undef APSTUDIO_READONLY_SYMBOLS

@@ -48,9 +31,10 @@ END

#endif    // APSTUDIO_INVOKED

 

-/**

- * Version definition.

- */

+/////////////////////////////////////////////////////////////////////////////

+//

+// Version

+//

VS_VERSION_INFO VERSIONINFO

  FILEVERSION RC_VERSION_NUMERICAL

  PRODUCTVERSION RC_VERSION_NUMERICAL

@@ -68,18 +52,16 @@ BEGIN

     BEGIN

         BLOCK "080904b0"

         BEGIN

-            VALUE "Comments", "\0"

-            VALUE "CompanyName", "NYSE Technologies\0"

-            VALUE "FileDescription", "MAMA API CPP\0"

+            VALUE "CompanyName", "NYSE Technologies"

+            VALUE "FileDescription", "MAMA API CPP"

             VALUE "FileVersion", RC_VERSION_STRING

-            VALUE "InternalName", "MAMA\0"

-            VALUE "LegalCopyright", "Copyright © 2009 NYSE Technologies\0"

+            VALUE "InternalName", "MAMACPP"

+            VALUE "LegalCopyright", "Copyright © 2012 NYSE Technologies"

             VALUE "LegalTrademarks", "\0"

             VALUE "OriginalFilename", RC_CPP_DLL_NAME

             VALUE "PrivateBuild", "\0"

-            VALUE "ProductName", "NYSE Technologies MAMA\0"

+            VALUE "ProductName", "NYSE Technologies MAMA"

             VALUE "ProductVersion", RC_VERSION_STRING

-            VALUE "SpecialBuild", "\0"

         END

     END

     BLOCK "VarFileInfo"

@@ -93,13 +75,3 @@ END

#ifndef APSTUDIO_INVOKED

#endif    // not APSTUDIO_INVOKED

-/*

- * $HeadURL$

- * $Revision$

- * $LastChangedDate$

- * $LastChangedBy$

- *

- * Copyright (c) 2009 NYSE Technologies

- * All rights reserved.

- */

-

--

1.7.9.5

 




Please consider the environment before printing this e-mail.

This e-mail may contain confidential and/or privileged information. If you are not the intended recipient or have received this e-mail in error, please advise the sender immediately by reply e-mail and delete this message and any attachments without retaining a copy.

Any unauthorised copying, disclosure or distribution of the material in this e-mail is strictly forbidden.

Join Openmama-dev@lists.openmama.org to automatically receive all group messages.