[msvc] Automatically update (win-)config.h with the correct version number
authorAlexander Köplinger <alex.koeplinger@outlook.com>
Mon, 7 Dec 2015 01:16:54 +0000 (02:16 +0100)
committerAlexander Köplinger <alex.koeplinger@outlook.com>
Mon, 7 Dec 2015 21:19:19 +0000 (22:19 +0100)
A small powershell command grabs the version number from configure.ac and uses it during winsetup.bat,
this way we don't have to manually keep them in sync.

msvc/winsetup.bat
winconfig.h

index f67a854569327dcbd8fb0d344ea2ed97de89c1f3..336778204f2a5dc3507a880bef2062e5bd669801 100755 (executable)
@@ -4,6 +4,7 @@ if exist config.h if not exist cygconfig.h copy config.h cygconfig.h
 if exist eglib\config.h if not exist eglib\cygconfig.h copy eglib\config.h eglib\cygconfig.h
 copy winconfig.h config.h
 copy eglib\winconfig.h eglib\config.h
+powershell -Command "(Get-Content config.h) -replace '#MONO_VERSION#', (Select-String -path configure.ac -pattern 'AC_INIT\(mono, \[(.*)\]').Matches[0].Groups[1].Value | Set-Content config.h"
 goto end
 :error
 echo fatal error: the VSDepenancies directory was not found in the "mono" directory
index 21f4fe7b1bb0a019a19265b46e40519a8c3dccde..64c8ba1b3a5247a7838b3b82d6bf093759bd9f86 100644 (file)
 /* #undef USE_MONO_MUTEX */
 
 /* Version number of package */
-#define VERSION "4.1.0"
+#define VERSION "#MONO_VERSION#"
 #endif