Include Mono version in corlib version
authorAlexander Köplinger <alex.koeplinger@outlook.com>
Thu, 16 Mar 2017 20:15:32 +0000 (21:15 +0100)
committerAlexander Köplinger <alex.koeplinger@outlook.com>
Thu, 16 Mar 2017 20:38:31 +0000 (21:38 +0100)
This makes it possible to version the runtime<->corlib interface
for each version branch independently and fixes the problem
of monolite getting overwritten by changes in different branches
when corlib version is still the same.

We're moving definition of the corlib version into configure.ac
so we can more easily bake the Mono version into it.

Makefile.am
configure.ac
mcs/build/Makefile
mcs/build/common/Consts.cs.in
mcs/class/Novell.Directory.Ldap/Novell.Directory.Ldap.dll.sources
mcs/class/System.Data/mobile_System.Data.dll.sources
mcs/class/System.DirectoryServices/System.DirectoryServices.dll.sources
mcs/class/corlib/System/Environment.cs
mono/metadata/appdomain.c
msvc/winsetup.bat
winconfig.h

index 16e5ba16c16ef6a2292039a17e01d5c1abd5043a..1dbe3b14a2ecd964a9bf9f6ce48492b3eed09520 100644 (file)
@@ -56,15 +56,14 @@ DISTCLEANFILES= mono-uninstalled.pc
 # building with monolite
 mcslib = $(mcs_topdir)/class/lib
 monolite = $(mcslib)/monolite
-mono_corlib_version = $(shell sed -n "s/\#define MONO_CORLIB_VERSION //p" $(srcdir)/mono/metadata/appdomain.c)
-monolite_url = http://download.mono-project.com/monolite/monolite-$(mono_corlib_version)-latest.tar.gz
+monolite_url = https://download.mono-project.com/monolite/monolite-$(MONO_CORLIB_VERSION)-latest.tar.gz
 .PHONY: get-monolite-latest 
 get-monolite-latest:
        -rm -fr $(mcslib)/monolite-*
        -mkdir -p $(mcslib)
        test ! -d $(monolite) || test ! -d $(monolite).old || rm -fr $(monolite).old
        test ! -d $(monolite) || mv -f $(monolite) $(monolite).old
-       cd $(mcslib) && { (wget -O- $(monolite_url) || curl $(monolite_url)) | gzip -d | tar xf - ; }
+       cd $(mcslib) && { (wget -O- $(monolite_url) || curl -L $(monolite_url)) | gzip -d | tar xf - ; }
        cd $(mcslib) && mv -f monolite-* monolite
 
 if BITCODE
index 187a683af4e265dd4687b43f5a35684dbdf3d121..cf871f8e485e0e2e6417a29b6d7d0085a09fba21 100644 (file)
@@ -29,6 +29,24 @@ AC_PROG_LN_S
 
 m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES([yes])])
 
+MONO_VERSION_MAJOR=`echo $VERSION | cut -d . -f 1`
+MONO_VERSION_MINOR=`echo $VERSION | cut -d . -f 2`
+MONO_VERSION_BUILD=`echo $VERSION | cut -d . -f 3`
+
+# This is the version number of the corlib-runtime interface. When
+# making changes to this interface (by changing the layout
+# of classes the runtime knows about, changing icall signature or
+# semantics etc), increment this variable.
+#
+# This can be reset to 0 when Mono's version number is bumped
+# since it's part of the corlib version (the prefix '1' in the full
+# version number is to ensure the number isn't treated as octal in C)
+MONO_CORLIB_COUNTER=0
+MONO_CORLIB_VERSION=`printf "1%02d%02d%02d%03d" $MONO_VERSION_MAJOR $MONO_VERSION_MINOR $MONO_VERSION_BUILD $MONO_CORLIB_COUNTER`
+
+AC_DEFINE_UNQUOTED(MONO_CORLIB_VERSION,$MONO_CORLIB_VERSION,[Version of the corlib-runtime interface])
+AC_SUBST(MONO_CORLIB_VERSION)
+
 case $host_os in
 *cygwin* )
                 echo "Run configure using ./configure --host=i686-pc-mingw32"
@@ -4535,6 +4553,7 @@ fi
     }')]
 
     echo "MONO_VERSION = $myver" >> $mcs_topdir/build/config.make
+    echo "MONO_CORLIB_VERSION = $MONO_CORLIB_VERSION" >> $mcs_topdir/build/config.make
 
     if test x$host_darwin = xyes; then
       echo "PLATFORM = darwin" >> $mcs_topdir/build/config.make
index 14ad0cbd10c74283e2d25bc4cb1682d77c5dcb90..5af3d0449898ad5d21b2a0a6ac5d1da61cf4f7f4 100644 (file)
@@ -12,7 +12,8 @@ clean-local:
 
 common/Consts.cs: common/Consts.cs.in $(wildcard config.make)
        test -n '$(MONO_VERSION)'
-       sed -e 's,@''MONO_VERSION@,$(MONO_VERSION),' $< > $@
+       test -n '$(MONO_CORLIB_VERSION)'
+       sed -e 's,@''MONO_VERSION@,$(MONO_VERSION),' -e 's,@''MONO_CORLIB_VERSION@,$(MONO_CORLIB_VERSION),' $< > $@
 
 PLATFORMS = darwin linux win32
 PROFILES = \
index 87b005e763a2c4b30abb0dd0f05862fe49c10380..8bb64bc43a700954c45074712655ac02159ec3fc 100644 (file)
@@ -38,6 +38,7 @@ static class Consts
        public const string MonoCompany = "Mono development team";
        public const string MonoProduct = "Mono Common Language Infrastructure";
        public const string MonoCopyright = "(c) Various Mono authors";
+       public const int MonoCorlibVersion = @MONO_CORLIB_VERSION@;
 
 #if MOBILE
        // Versions of .NET Framework for Silverlight 4.0
index d5010fd1970591d149e8ac43a38e5c4990a7651b..7c62434346c2e711f6622fdf8c10045339e968d9 100755 (executable)
@@ -1,5 +1,5 @@
 Novell.Directory.Ldap/AssemblyInfo.cs
-../../build/common/Consts.cs.in
+../../build/common/Consts.cs
 Novell.Directory.Ldap/SupportClass.cs
 Novell.Directory.Ldap.Utilclass/Base64.cs
 Novell.Directory.Ldap.Utilclass/DN.cs
index c80fb2a16e4ee20291584e2d01805c8c9df28985..cbf257234a78565aed5f2f8a6eae698bfebe3705 100644 (file)
@@ -1,5 +1,5 @@
 Assembly/AssemblyInfo.cs
-../../build/common/Consts.cs.in
+../../build/common/Consts.cs
 ../../build/common/Locale.cs
 ../../build/common/SR.cs
 ../../build/common/MonoTODOAttribute.cs
index acaf20cac11e7d6f21ba27ecd88aa28c7f419b8f..5861a327a1516252604c2f1fbb4a818bef9e8f8b 100644 (file)
@@ -1,5 +1,5 @@
 Assembly/AssemblyInfo.cs
-../../build/common/Consts.cs.in
+../../build/common/Consts.cs
 ../../build/common/Locale.cs
 System.DirectoryServices/ActiveDirectoryAccessRule.cs
 System.DirectoryServices/ActiveDirectoryAuditRule.cs
index 72bf7779d501992cfca5ba03a9a038e16d926963..04247b244502738e218987625d7d650ef820e719 100644 (file)
@@ -48,16 +48,11 @@ namespace System {
        public static partial class Environment {
 
                /*
-                * This is the version number of the corlib-runtime interface. When
-                * making changes to this interface (by changing the layout
-                * of classes the runtime knows about, changing icall signature or
-                * semantics etc), increment this variable. Also increment the
-                * pair of this variable in the runtime in metadata/appdomain.c.
-                * Changes which are already detected at runtime, like the addition
-                * of icalls, do not require an increment.
+                * This is the version number of the corlib-runtime interface.
+                * It is defined in configure.ac.
                 */
 #pragma warning disable 169
-               private const int mono_corlib_version = 164;
+               private const int mono_corlib_version = Consts.MonoCorlibVersion;
 #pragma warning restore 169
 
                [ComVisible (true)]
index 9d0576f6c4271a9b012106d499253c8ea4484e9a..77f2c7d123397b532506d8c7fe91cfd03e048579 100644 (file)
 #include <direct.h>
 #endif
 
-/*
- * This is the version number of the corlib-runtime interface. When
- * making changes to this interface (by changing the layout
- * of classes the runtime knows about, changing icall signature or
- * semantics etc), increment this variable. Also increment the
- * pair of this variable in mscorlib in:
- *       mcs/class/corlib/System/Environment.cs
- *
- * Changes which are already detected at runtime, like the addition
- * of icalls, do not require an increment.
- */
-#define MONO_CORLIB_VERSION 164
-
 typedef struct
 {
        int runtime_count;
index e6afb26d8ff37979b08de265bda5f08c04d6ce23..d3729144a610939269165092422bce631af42d6a 100755 (executable)
@@ -22,6 +22,7 @@ IF NOT %ERRORLEVEL% == 0 (
        ECHO copy %WIN_CONFIG_H% %CONFIG_H%
        copy %WIN_CONFIG_H% %CONFIG_H%
        %windir%\system32\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -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%" 2>&1
+       %windir%\system32\WindowsPowerShell\v1.0\powershell.exe -NonInteractive -Command "$mono_version=[int[]](Select-String -path %CONFIGURE_AC% -pattern 'AC_INIT\(mono, \[(.*)\]').Matches[0].Groups[1].Value.Split('.'); $corlib_counter=[int](Select-String -path %CONFIGURE_AC% -pattern 'MONO_CORLIB_COUNTER=(.*)').Matches[0].Groups[1].Value; (Get-Content %CONFIG_H%) -replace '#MONO_CORLIB_VERSION#',('1{0:00}{1:00}{2:00}{3:000}' -f $mono_version[0],$mono_version[1],$mono_version[2],$corlib_counter) | Set-Content %CONFIG_H%" 2>&1
 )
 
 %windir%\system32\WindowsPowerShell\v1.0\powershell.exe -executionpolicy bypass -NonInteractive -File compare-config-files.ps1 %EGLIB_WIN_CONFIG_H% %EGLIB_CONFIG_H% 2>&1
index 37a232b6a53a1715de5a96064b544663f18252ad..6a4873657aa8d012c32b2183dcf7efaeaf2ac680 100644 (file)
 
 /* Version number of package */
 #define VERSION "#MONO_VERSION#"
+
+/* Version of the corlib-runtime interface */
+#define MONO_CORLIB_VERSION #MONO_CORLIB_VERSION#
+
 #endif