Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJay Krell <jay.krell@cornell.edu>2019-03-25 12:55:15 +0300
committerAlexander Köplinger <alex.koeplinger@outlook.com>2019-03-25 12:55:15 +0300
commit004314e9ddf5dd93c7d9f2a3b696c5e10194fb71 (patch)
treef9f0c6e399746957b3ca0186da930dd27ee989f7
parenteb1cb188a6a3b4797a34ffb4510d7b36dab9a0ef (diff)
[windows]Fix and cleanup configure.ac parsing for MONO_CORLIB_VERSION and ACINIT. (#13630)
Not just a guid or an uppercase guid.
-rw-r--r--configure.ac17
-rw-r--r--msvc/mono.winconfig.targets61
2 files changed, 59 insertions, 19 deletions
diff --git a/configure.ac b/configure.ac
index 6a3c01d24ac..cf11fb3c060 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1,6 +1,9 @@
# Process this file with autoconf to produce a configure script.
#AC_PREREQ([2.62])
+# This line is parsed by tools besides autoconf, such as msvc/mono.winconfig.targets.
+# It should remain in the format they expect.
+#
AC_INIT(mono, [6.1.0],
[https://github.com/mono/mono/issues/new])
@@ -40,13 +43,21 @@ MONO_VERSION_BUILD=`echo $VERSION | cut -d . -f 3`
# of classes the runtime knows about, changing icall signature or
# semantics etc), change this variable.
#
-# This must be unique relative to corlib interface/semantics.
+# This must be unique relative to corlib interface and semantics.
+#
+# If you change corlib such that a runtime change is required, or
+# vice versa, change this string. Examples include removing icalls,
+# adding icalls, changing icall signatures, and changing type layouts
+# that both sides know.
+#
+# It is an arbitrary string and should be parsed as such.
+# A guid works and is encouraged.
#
# Generate it with uuidgen. For example:
# perl -pi.bak -e "s/^MONO_CORLIB_VERSION=\S+/MONO_CORLIB_VERSION=`uuidgen`/" configure.ac
#
-# There is no ordering of corlib versions, no old or new,
-# the runtime expects an exact match.
+# This line is parsed by tools besides autoconf, such as msvc/mono.winconfig.targets.
+# It should remain in the format they expect.
#
MONO_CORLIB_VERSION=4A9CEBCF-2544-4CB4-9F84-07A10C16BEEB
diff --git a/msvc/mono.winconfig.targets b/msvc/mono.winconfig.targets
index cc0b51a7b11..17f3539d12e 100644
--- a/msvc/mono.winconfig.targets
+++ b/msvc/mono.winconfig.targets
@@ -22,35 +22,51 @@
public class _WinConfigSetup : Task
{
- void GetVersionsFromConfigureAC (string configureACFile, out string monoVersion, out string monoCorlibVersion)
- {
+ bool GetVersionsFromConfigureAC (string configureACFile, out string monoVersion, out string monoCorlibVersion)
+ {
+ bool result = true;
monoVersion = null;
monoCorlibVersion = null;
if (File.Exists (configureACFile))
- {
- var monoVersionRegEx = new Regex (@"(.*AC_INIT\(mono, \[)(\d+\.\d+\.\d+)");
- var monoCorlibVersionRegEx = new Regex (@"(MONO_CORLIB_VERSION=)([A-F0-9]{8}(?:-[A-F0-9]{4}){3}-[A-F0-9]{12})");
+ {
+ // These are both fairly arbitrary strings.
+ var monoVersionRegEx = new Regex (@"^AC_INIT\s*\(\s*mono,\s*\[?\s*([^\],\s]+)");
+ var monoCorlibVersionRegEx = new Regex (@"^MONO_CORLIB_VERSION\s*=\s*(\S+)");
using (StreamReader reader = new StreamReader (configureACFile))
- {
+ {
string line;
while ((line = reader.ReadLine ()) != null && (monoVersion == null || monoCorlibVersion == null))
- {
+ {
var monoVersionMatch = monoVersionRegEx.Match (line);
- if (monoVersionMatch != null && monoVersionMatch.Success && monoVersionMatch.Groups.Count == 3)
- {
- monoVersion = monoVersionMatch.Groups[2].Value;
+ if (monoVersionMatch.Success)
+ {
+ if (monoVersion != null)
+ {
+ Log.LogError("duplicate MONO_INIT in {0}", configureACFile);
+ result = false;
+ }
+ monoVersion = monoVersionMatch.Groups[1].Value;
+ Log.LogMessage ("{0}:AC_INIT:MONO_VERSION=\"{1}\"", configureACFile, monoVersion);
continue;
}
var monoCorlibVersionMatch = monoCorlibVersionRegEx.Match (line);
- if (monoCorlibVersionMatch != null && monoCorlibVersionMatch.Success && monoCorlibVersionMatch.Groups.Count == 3)
- {
- monoCorlibVersion = monoCorlibVersionMatch.Groups[2].Value;
+ if (monoCorlibVersionMatch.Success)
+ {
+ if (monoCorlibVersion != null)
+ {
+ // This is misleading. The loop stops when both found, so duplicates usually not noticed.
+ Log.LogError("duplicate MONO_CORLIB_VERSION in {0}", configureACFile);
+ result = false;
+ }
+ monoCorlibVersion = monoCorlibVersionMatch.Groups[1].Value;
+ Log.LogMessage ("{0}:MONO_CORLIB_VERSION=\"{1}\"", configureACFile, monoCorlibVersion);
continue;
}
}
}
- }
+ }
+ return result;
}
string [] GetDisabledConfigFeatures (string path)
@@ -258,7 +274,20 @@
string monoVersion = null;
string monoCorlibVersion = null;
- GetVersionsFromConfigureAC (configureACFile, out monoVersion, out monoCorlibVersion);
+ if (!GetVersionsFromConfigureAC (configureACFile, out monoVersion, out monoCorlibVersion))
+ return false;
+
+ if (monoVersion == null)
+ {
+ Log.LogError("failed to parse version from AC_INIT in {0}", configureACFile);
+ return false;
+ }
+
+ if (monoCorlibVersion == null)
+ {
+ Log.LogError("failed to parse MONO_CORLIB_VERSION from {0}", configureACFile);
+ return false;
+ }
var disableDefines = GetDisabledConfigFeatures (cygConfigFile);
var enableDefines = (EnableDefines != null) ? EnableDefines.Split (';') : null;
@@ -267,7 +296,7 @@
CreateVersionFile (versionFile);
- Log.LogMessage (MessageImportance.High, "Successfully setup Mono configuration headers.");
+ Log.LogMessage (MessageImportance.High, "Successfully setup Mono configuration headers {0} and {1} from {2}.", configFile, versionFile, winConfigFile);
return true;
}