Просмотр исходного кода

Merge branch 'master' of github.com:mono/mono

Atsushi Eno 15 лет назад
Родитель
Сommit
d1ef303ddd

+ 13 - 2
configure.in

@@ -621,17 +621,23 @@ AC_ARG_WITH(tls, [  --with-tls=__thread,pthread    select Thread Local Storage i
 AC_ARG_WITH(sigaltstack, [  --with-sigaltstack=yes,no      enable/disable support for sigaltstack (defaults to yes)],[],[with_sigaltstack=yes])
 
 AC_ARG_WITH(static_mono, [  --with-static_mono=yes,no      link mono statically to libmono (faster) (defaults to yes)],[],[with_static_mono=yes])
+AC_ARG_WITH(shared_mono, [  --with-shared_mono=yes,no      build a shared libmono library (defaults to yes)],[],[with_shared_mono=yes])
 
 if test "x$enable_static" = "xno"; then
    with_static_mono=no
 fi
 
+if test "x$enable_shared" = "xno"; then
+   with_shared_mono=no
+fi
+
 if test "x$host_win32" = "xyes"; then
    # Boehm GC requires the runtime to be in its own dll
    with_static_mono=no
 fi
 
 AM_CONDITIONAL(STATIC_MONO, test x$with_static_mono != xno)
+AM_CONDITIONAL(SHARED_MONO, test x$with_shared_mono != xno)
 AC_ARG_ENABLE(mcs-build, [  --disable-mcs-build disable the build of the mcs directory], try_mcs_build=$enableval, enable_mcs_build=yes)
 
 AC_ARG_WITH(xen_opt,   [  --with-xen_opt=yes,no          Enable Xen-specific behaviour (defaults to yes)],[],[with_xen_opt=yes])
@@ -666,7 +672,7 @@ DISABLED_FEATURES=none
 
 AC_ARG_ENABLE(minimal, [  --enable-minimal=LIST      drop support for LIST subsystems.
      LIST is a comma-separated list from: aot, profiler, decimal, pinvoke, debug,
-     reflection_emit, reflection_emit_save, large_code, logging, com, ssa, generics, attach, jit, simd, soft_debug, normalization.],
+     reflection_emit, reflection_emit_save, large_code, logging, com, ssa, generics, attach, jit, simd, soft_debug, normalization, assembly_remapping.],
 [
 	for feature in `echo "$enable_minimal" | sed -e "s/,/ /g"`; do
 		eval "mono_feature_disable_$feature='yes'"
@@ -786,6 +792,11 @@ if test "x$mono_feature_disable_normalization" = "xyes"; then
 	AC_MSG_NOTICE([Disabled String normalization support.])
 fi
 
+if test "x$mono_feature_disable_assembly_remapping" = "xyes"; then
+	AC_DEFINE(DISABLE_ASSEMBLY_REMAPPING, 1, [Disable assembly remapping.])
+	AC_MSG_NOTICE([Disabled Assembly remapping.])
+fi
+
 AC_MSG_CHECKING(for visibility __attribute__)
 AC_TRY_COMPILE([], [
    void __attribute__ ((visibility ("hidden"))) doit (void) {}
@@ -2591,7 +2602,7 @@ AC_ARG_WITH(mcs_docs,[  --with-mcs-docs=yes,no         If you want to build the
 
 MOONLIGHT_DEFINES=
 AC_ARG_WITH(moonlight, [  --with-moonlight=yes|no|only         If you want to build Mono for Moonlight (defaults to no)],[
-        MOONLIGHT_DEFINES="-DMOONLIGHT"
+        MOONLIGHT_DEFINES="-DMOONLIGHT -DDISABLE_ASSEMBLY_REMAPPING"
 ], [with_moonlight=no])
 AC_SUBST(MOONLIGHT_DEFINES)
 

+ 8 - 5
mcs/class/Mono.Posix/Mono.Unix/UnixSignal.cs

@@ -96,6 +96,12 @@ namespace Mono.Unix {
 
 		[UnmanagedFunctionPointer (CallingConvention.Cdecl)]
 		delegate int Mono_Posix_RuntimeIsShuttingDown ();
+		static Mono_Posix_RuntimeIsShuttingDown ShuttingDown = RuntimeShuttingDownCallback;
+		
+		static int RuntimeShuttingDownCallback ()
+		{
+			return Environment.HasShutdownStarted ? 1 : 0;
+		}
 
 		[DllImport (Stdlib.MPH, CallingConvention=CallingConvention.Cdecl,
 				EntryPoint="Mono_Unix_UnixSignal_WaitAny")]
@@ -190,6 +196,7 @@ namespace Mono.Unix {
 			return WaitAny (signals, (int) ms);
 		}
 
+			
 		public static unsafe int WaitAny (UnixSignal[] signals, int millisecondsTimeout)
 		{
 			if (signals == null)
@@ -202,11 +209,7 @@ namespace Mono.Unix {
 				if (infos [i] == IntPtr.Zero)
 					throw new InvalidOperationException ("Disposed UnixSignal");
 			}
-			Mono_Posix_RuntimeIsShuttingDown shutting_down = () =>
-				Environment.HasShutdownStarted ? 1 : 0;
-			int r = WaitAny (infos, infos.Length, millisecondsTimeout, shutting_down);
-			GC.KeepAlive (shutting_down);
-			return r;
+			return WaitAny (infos, infos.Length, millisecondsTimeout, ShuttingDown);
 		}
 	}
 }

+ 1 - 1
mcs/class/System/System.Net/WebRequest.cs

@@ -286,7 +286,7 @@ namespace System.Net
 		{
 			if (requestUri == null)
 				throw new ArgumentNullException ("requestUri");
-			return GetCreator (requestUri.AbsoluteUri).Create (requestUri);
+			return GetCreator (requestUri.Scheme).Create (requestUri);
 		}
 		
 		public static WebRequest CreateDefault (Uri requestUri)

+ 80 - 65
mcs/class/System/System/Uri.cs

@@ -986,9 +986,10 @@ namespace System {
 		//
 		public Uri MakeRelativeUri (Uri uri)
 		{
+#if NET_4_0
 			if (uri == null)
 				throw new ArgumentNullException ("uri");
-
+#endif
 			if (Host != uri.Host || Scheme != uri.Scheme)
 				return uri;
 
@@ -1111,6 +1112,7 @@ namespace System {
 		private const string EscapeCommonHex = EscapeCommon + EscapeHex;
 		private const string EscapeCommonBrackets = EscapeCommon + EscapeBrackets;
 		internal const string EscapeCommonHexBrackets = EscapeCommon + EscapeHex + EscapeBrackets;
+		internal const string EscapeCommonHexBracketsQuery = EscapeCommonHexBrackets + "?";
 
 		internal static string EscapeString (string str, string escape) 
 		{
@@ -1302,6 +1304,11 @@ namespace System {
 				throw new UriFormatException (s);
 		}
 
+		private bool SupportsQuery ()
+		{
+			return ((scheme != Uri.UriSchemeNntp) && (scheme != Uri.UriSchemeFtp) && (scheme != Uri.UriSchemeFile));
+		}
+
 		//
 		// This parse method will not throw exceptions on failure
 		//
@@ -1412,8 +1419,8 @@ namespace System {
 				return null;
 			}
 
-			// special case: there is no query part for 'nntp' and 'ftp' but there is an host, port, user...
-			if ((scheme != Uri.UriSchemeNntp) && (scheme != Uri.UriSchemeFtp)) {
+			// special case: there is no query part for 'nntp', 'file' and 'ftp' but there is an host, port, user...
+			if (SupportsQuery ()) {
 				// 6 query
 				pos = uriString.IndexOf ('?', startpos, endpos-startpos);
 				if (pos != -1) {
@@ -1470,31 +1477,24 @@ namespace System {
 			}
 
 			// 5 path
-			if ((scheme == Uri.UriSchemeNntp) || (scheme == Uri.UriSchemeFtp)) {
+			if (unixAbsPath) {
+				pos = -1;
+			} else {
 				pos = uriString.IndexOf ('/', startpos, endpos - startpos);
-				if (pos != -1) {
-					path = uriString.Substring (pos, endpos - pos);
-					if (scheme == Uri.UriSchemeFtp)
+				if (pos == -1 && windowsFilePath)
+					pos = uriString.IndexOf ('\\', startpos, endpos - startpos);
+			}
+			if (pos != -1) {
+				path = uriString.Substring (pos, endpos - pos);
+				if (!SupportsQuery ()) {
+					if (scheme != Uri.UriSchemeNntp)
 						path = path.Replace ('\\', '/');
 					path = EscapeString (path, EscapeNews);
-					endpos = pos;
 				}
+				endpos = pos;
 			} else {
-				if (unixAbsPath) {
-					pos = -1;
-				} else {
-					pos = uriString.IndexOf ('/', startpos, endpos - startpos);
-					if (pos == -1 && windowsFilePath)
-						pos = uriString.IndexOf ('\\', startpos, endpos - startpos);
-				}
-
-				if (pos == -1) {
-					if (scheme != Uri.UriSchemeMailto)
-						path = "/";
-				} else {
-					path = uriString.Substring (pos, endpos - pos);
-					endpos = pos;
-				}
+				if (scheme != Uri.UriSchemeMailto)
+					path = "/";
 			}
 
 			// 4.a user info
@@ -1598,6 +1598,36 @@ namespace System {
 			return false;
 		}
 
+		// replace '\', %5C ('\') and %2f ('/') into '/'
+		// replace %2e ('.') into '.'
+		private static string NormalizePath (string path)
+		{
+			StringBuilder res = new StringBuilder ();
+			for (int i = 0; i < path.Length; i++) {
+				char c = path [i];
+				switch (c) {
+				case '\\':
+					c = '/';
+					break;
+				case '%':
+					if (i < path.Length - 2) {
+						char c1 = path [i + 1];
+						char c2 = Char.ToUpper (path [i + 2]);
+						if ((c1 == '2') && (c2 == 'E')) {
+							c = '.';
+							i += 2;
+						} else if (((c1 == '2') && (c2 == 'F')) || ((c1 == '5') && (c2 == 'C'))) {
+							c = '/';
+							i += 2;
+						}
+					}
+					break;
+				}
+				res.Append (c);
+			}
+			return res.ToString ();
+		}
+
 		// This is called "compacting" in the MSDN documentation
 		private static string Reduce (string path, bool compact_escaped)
 		{
@@ -1605,47 +1635,22 @@ namespace System {
 			if (path == "/")
 				return path;
 
-			StringBuilder res = new StringBuilder();
-
-			if (compact_escaped) {
-				// replace '\', %5C ('\') and %2f ('/') into '/'
+			if (compact_escaped && (path.IndexOf ('%') != -1)) {
+				// replace '\', %2f, %5c with '/' and replace %2e with '.'
 				// other escaped values seems to survive this step
-				for (int i=0; i < path.Length; i++) {
-					char c = path [i];
-					switch (c) {
-					case '\\':
-						res.Append ('/');
-						break;
-					case '%':
-						if (i < path.Length - 2) {
-							char c1 = path [i + 1];
-							char c2 = Char.ToUpper (path [i + 2]);
-							if (((c1 == '2') && (c2 == 'F')) || ((c1 == '5') && (c2 == 'C'))) {
-								res.Append ('/');
-								i += 2;
-							} else {
-								res.Append (c);
-							}
-						} else {
-							res.Append (c);
-						}
-						break;
-					default:
-						res.Append (c);
-						break;
-					}
-				}
-				path = res.ToString ();
+				path = NormalizePath (path);
 			} else {
+				// (always) replace '\' with '/'
 				path = path.Replace ('\\', '/');
 			}
 
-			ArrayList result = new ArrayList ();
+			List<string> result = new List<string> ();
 
 			bool begin = true;
 			for (int startpos = 0; startpos < path.Length; ) {
-				int endpos = path.IndexOf('/', startpos);
-				if (endpos == -1) endpos = path.Length;
+				int endpos = path.IndexOf ('/', startpos);
+				if (endpos == -1)
+					endpos = path.Length;
 				string current = path.Substring (startpos, endpos-startpos);
 				startpos = endpos + 1;
 				if ((begin && current.Length == 0) || current == "." ) {
@@ -1671,7 +1676,8 @@ namespace System {
 			if (result.Count == 0)
 				return "/";
 
-			res.Length = 0;
+			StringBuilder res = new StringBuilder ();
+
 			if (path [0] == '/')
 				res.Append ('/');
 
@@ -2076,12 +2082,21 @@ namespace System {
 		// [MonoTODO ("rework code to avoid exception catching")]
 		public static bool TryCreate (Uri baseUri, string relativeUri, out Uri result)
 		{
+			result = null;
+			if (relativeUri == null)
+				return false;
+
 			try {
-				// FIXME: this should call UriParser.Resolve
-				result = new Uri (baseUri, relativeUri);
-				return true;
+				Uri relative = new Uri (relativeUri, UriKind.RelativeOrAbsolute);
+				if ((baseUri != null) && baseUri.IsAbsoluteUri) {
+					// FIXME: this should call UriParser.Resolve
+					result = new Uri (baseUri, relative);
+				} else if (relative.IsAbsoluteUri) {
+					// special case - see unit tests
+					result = relative;
+				}
+				return (result != null);
 			} catch (UriFormatException) {
-				result = null;
 				return false;
 			}
 		}
@@ -2089,18 +2104,18 @@ namespace System {
 		//[MonoTODO ("rework code to avoid exception catching")]
 		public static bool TryCreate (Uri baseUri, Uri relativeUri, out Uri result)
 		{
+			result = null;
+			if ((baseUri == null) || !baseUri.IsAbsoluteUri)
+				return false;
 #if NET_4_0
-			if (relativeUri == null) {
-				result = null;
+			if (relativeUri == null)
 				return false;
-			}
 #endif
 			try {
 				// FIXME: this should call UriParser.Resolve
 				result = new Uri (baseUri, relativeUri.OriginalString);
 				return true;
 			} catch (UriFormatException) {
-				result = null;
 				return false;
 			}
 		}

+ 270 - 279
mcs/class/System/System/UriBuilder.cs

@@ -1,279 +1,270 @@
-//
-// System.UriBuilder
-//
-// Author:
-//   Lawrence Pit ([email protected])
-//
-// Copyright (C) 2005 Novell, Inc (http://www.novell.com)
-//
-// Permission is hereby granted, free of charge, to any person obtaining
-// a copy of this software and associated documentation files (the
-// "Software"), to deal in the Software without restriction, including
-// without limitation the rights to use, copy, modify, merge, publish,
-// distribute, sublicense, and/or sell copies of the Software, and to
-// permit persons to whom the Software is furnished to do so, subject to
-// the following conditions:
-// 
-// The above copyright notice and this permission notice shall be
-// included in all copies or substantial portions of the Software.
-// 
-// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
-// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
-// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
-// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
-// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
-// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
-// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-//
-
-using System;
-using System.Collections;
-using System.Runtime.Serialization;
-using System.Text;
-
-// See RFC 2396 for more info on URI's.
-
-namespace System 
-{
-	public class UriBuilder
-	{
-		private string scheme;
-		private string host;
-		private int port;
-		private string path;
-		private string query;
-		private string fragment;
-		private string username;
-		private string password;
-		
-		private Uri uri;
-		private bool modified;
-		
-		
-		// Constructors
-		
-		public UriBuilder ()
-#if NET_2_0
-			: this (Uri.UriSchemeHttp, "localhost")
-#else
-			: this (Uri.UriSchemeHttp, "loopback")
-#endif
-		{
-		}
-
-		public UriBuilder (string uri) : this (new Uri (uri))
-		{
-		}
-		
-		public UriBuilder (Uri uri)
-		{
-			scheme = uri.Scheme;
-			host = uri.Host;
-			port = uri.Port;
-			path = uri.AbsolutePath;
-			query = uri.Query;
-			fragment = uri.Fragment;
-			username = uri.UserInfo;
-			int pos = username.IndexOf (':');
-			if (pos != -1) {
-				password = username.Substring (pos + 1);
-				username = username.Substring (0, pos);
-			} else {
-				password = String.Empty;
-			}
-			modified = true;
-		}
-		
-		public UriBuilder (string schemeName, string hostName) 
-		{
-			Scheme = schemeName;
-			Host = hostName;
-			port = -1;
-			Path = String.Empty;   // dependent on scheme it may set path to "/"
-			query = String.Empty;
-			fragment = String.Empty;
-			username = String.Empty;
-			password = String.Empty;
-			modified = true;
-		}
-		
-		public UriBuilder (string scheme, string host, int portNumber) 
-			: this (scheme, host)
-		{
-			Port = portNumber;
-		}
-		
-		public UriBuilder (string scheme, string host, int port, string pathValue)
-			: this (scheme, host, port)
-		{
-			Path = pathValue;
-		}
-
-		public UriBuilder (string scheme, string host, int port, string pathValue, string extraValue)
-			: this (scheme, host, port, pathValue)
-		{
-			if (extraValue == null || extraValue.Length == 0)
-				return;
-				
-			if (extraValue [0] == '#') 
-				Fragment = extraValue.Remove (0, 1);
-			else if (extraValue [0] == '?') 
-				Query = extraValue.Remove (0, 1);
-			else 
-				throw new ArgumentException ("extraValue");
-		}
-
-		
-		// Properties
-		
-		public string Fragment {
-			get { return fragment; }
-			set {
-				fragment = value;
-				if (fragment == null)
-					fragment = String.Empty;
-				else if (fragment.Length > 0)
-//					fragment = "#" + EncodeUtf8 (value.Replace ("%23", "#"));
-					fragment = "#" + value.Replace ("%23", "#");
-#if !NET_2_0
-				query = String.Empty;
-#endif
-				modified = true;
-			}
-		}
-
-		public string Host {
-			get { return host; }
-			set {
-				host = (value == null) ? String.Empty : value;;
-				modified = true;
-			}
-		}
-
-		public string Password {
-			get { return password; }
-			set {
-				password = (value == null) ? String.Empty : value;;
-				modified = true;
-			}
-		}
-		
-		public string Path {
-			get { return path; }
-			set {
-				if (value == null || value.Length == 0) {
-					path = "/";
-				} else {
-					path = Uri.EscapeString (value.Replace ('\\', '/'), Uri.EscapeCommonHexBrackets);
-				}
-				modified = true;
-			}
-		}
-		
-		public int Port {
-			get { return port; }
-			set {
-#if NET_2_0
-				if (value < -1)
-					throw new ArgumentOutOfRangeException ("value");
-#else
-				if (value < 0)
-					throw new ArgumentOutOfRangeException ("value");
-#endif
-				// apparently it is
-				port = value;
-				modified = true;
-			}
-		}
-		
-		public string Query {
-			get { return query; }
-			set {
-				// LAMESPEC: it doesn't say to always prepend a 
-				// question mark to the value.. it does say this 
-				// for fragment.
-				if (value == null || value.Length == 0)
-					query = String.Empty;
-				else
-//					query = "?" + EncodeUtf8 (value);
-					query = "?" + value;
-#if !NET_2_0
-				fragment = String.Empty;
-#endif
-				modified = true;
-			}
-		}
-		
-		public string Scheme {
-			get { return scheme; }
-			set {
-				if (value == null)
-					value = String.Empty;
-				int colonPos = value.IndexOf (':');
-				if (colonPos != -1)
-					value = value.Substring (0, colonPos);
-				scheme = value.ToLower ();
-				modified = true;
-			}
-		}
-		
-		public Uri Uri {
-			get {
-				if (!modified) 
-					return uri;
-				uri = new Uri (ToString (), true);
-				modified = false;
-				return uri;
-			}
-		}
-		
-		public string UserName {
-			get { return username; }
-			set {
-				username = (value == null) ? String.Empty : value;;
-				modified = true;
-			}
-		}
-
-		// Methods
-		
-		public override bool Equals (object rparam) 
-		{
-			return (rparam == null) ? false : this.Uri.Equals (rparam.ToString ());
-		}
-		
-		public override int GetHashCode ()
-		{
-			return this.Uri.GetHashCode ();
-		}
-		
-		public override string ToString ()
-		{
-			StringBuilder builder = new StringBuilder ();
-
-			builder.Append (scheme);
-			builder.Append ("://");
-
-			if (username != String.Empty) {
-				builder.Append (username);
-				if (password != String.Empty)
-					builder.Append (":" + password);
-				builder.Append ('@');
-			}
-
-			builder.Append (host);
-			if (port > 0)
-				builder.Append (":" + port);
-
-			if (path != String.Empty &&
-			    builder [builder.Length - 1] != '/' &&
-			    path.Length > 0 && path [0] != '/')
-				builder.Append ('/');
-			builder.Append (path);
-			builder.Append (query);
-			builder.Append (fragment);
-
-			return builder.ToString ();
-		}
-	}
-}
+//
+// System.UriBuilder
+//
+// Author:
+//   Lawrence Pit ([email protected])
+//
+// Copyright (C) 2005, 2010 Novell, Inc (http://www.novell.com)
+//
+// Permission is hereby granted, free of charge, to any person obtaining
+// a copy of this software and associated documentation files (the
+// "Software"), to deal in the Software without restriction, including
+// without limitation the rights to use, copy, modify, merge, publish,
+// distribute, sublicense, and/or sell copies of the Software, and to
+// permit persons to whom the Software is furnished to do so, subject to
+// the following conditions:
+// 
+// The above copyright notice and this permission notice shall be
+// included in all copies or substantial portions of the Software.
+// 
+// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
+// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
+// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
+// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
+// LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
+// OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
+// WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+//
+
+using System;
+using System.Collections;
+using System.Runtime.Serialization;
+using System.Text;
+
+// See RFC 2396 for more info on URI's.
+
+namespace System 
+{
+	public class UriBuilder
+	{
+		private string scheme;
+		private string host;
+		private int port;
+		private string path;
+		private string query;
+		private string fragment;
+		private string username;
+		private string password;
+		
+		private Uri uri;
+		private bool modified;
+		
+		
+		// Constructors
+		
+		public UriBuilder ()
+			: this (Uri.UriSchemeHttp, "localhost")
+		{
+		}
+
+		public UriBuilder (string uri) : this (new Uri (uri))
+		{
+		}
+		
+		public UriBuilder (Uri uri)
+		{
+#if NET_4_0
+			if (uri == null)
+				throw new ArgumentNullException ("uri");
+#endif
+			scheme = uri.Scheme;
+			host = uri.Host;
+			port = uri.Port;
+			path = uri.AbsolutePath;
+			query = uri.Query;
+			fragment = uri.Fragment;
+			username = uri.UserInfo;
+			int pos = username.IndexOf (':');
+			if (pos != -1) {
+				password = username.Substring (pos + 1);
+				username = username.Substring (0, pos);
+			} else {
+				password = String.Empty;
+			}
+			modified = true;
+		}
+		
+		public UriBuilder (string schemeName, string hostName) 
+		{
+			Scheme = schemeName;
+			Host = hostName;
+			port = -1;
+			Path = String.Empty;   // dependent on scheme it may set path to "/"
+			query = String.Empty;
+			fragment = String.Empty;
+			username = String.Empty;
+			password = String.Empty;
+			modified = true;
+		}
+		
+		public UriBuilder (string scheme, string host, int portNumber) 
+			: this (scheme, host)
+		{
+			Port = portNumber;
+		}
+		
+		public UriBuilder (string scheme, string host, int port, string pathValue)
+			: this (scheme, host, port)
+		{
+			Path = pathValue;
+		}
+
+		public UriBuilder (string scheme, string host, int port, string pathValue, string extraValue)
+			: this (scheme, host, port, pathValue)
+		{
+			if (extraValue == null || extraValue.Length == 0)
+				return;
+				
+			if (extraValue [0] == '#') 
+				Fragment = extraValue.Remove (0, 1);
+			else if (extraValue [0] == '?') 
+				Query = extraValue.Remove (0, 1);
+			else 
+				throw new ArgumentException ("extraValue");
+		}
+
+		
+		// Properties
+		
+		public string Fragment {
+			get { return fragment; }
+			set {
+				fragment = value;
+				if (fragment == null)
+					fragment = String.Empty;
+				else if (fragment.Length > 0)
+					fragment = "#" + value.Replace ("%23", "#");
+				modified = true;
+			}
+		}
+
+		public string Host {
+			get { return host; }
+			set {
+				host = (value == null) ? String.Empty : value;
+				modified = true;
+			}
+		}
+
+		public string Password {
+			get { return password; }
+			set {
+				password = (value == null) ? String.Empty : value;
+			}
+		}
+		
+		public string Path {
+			get { return path; }
+			set {
+				if (value == null || value.Length == 0) {
+					path = "/";
+				} else {
+					path = Uri.EscapeString (value.Replace ('\\', '/'), Uri.EscapeCommonHexBracketsQuery);
+				}
+				modified = true;
+			}
+		}
+		
+		public int Port {
+			get { return port; }
+			set {
+				if (value < -1)
+					throw new ArgumentOutOfRangeException ("value");
+				// apparently it is
+				port = value;
+				modified = true;
+			}
+		}
+		
+		public string Query {
+			get { return query; }
+			set {
+				// LAMESPEC: it doesn't say to always prepend a 
+				// question mark to the value.. it does say this 
+				// for fragment.
+				if (value == null || value.Length == 0)
+					query = String.Empty;
+				else
+					query = "?" + value;
+				modified = true;
+			}
+		}
+		
+		public string Scheme {
+			get { return scheme; }
+			set {
+				if (value == null)
+					value = String.Empty;
+				int colonPos = value.IndexOf (':');
+				if (colonPos != -1)
+					value = value.Substring (0, colonPos);
+				scheme = value.ToLower ();
+				modified = true;
+			}
+		}
+		
+		public Uri Uri {
+			get {
+				if (!modified) 
+					return uri;
+				uri = new Uri (ToString (), true);
+				// some properties are updated once the Uri is created - see unit tests
+				host = uri.Host;
+				modified = false;
+				return uri;
+			}
+		}
+		
+		public string UserName {
+			get { return username; }
+			set {
+				username = (value == null) ? String.Empty : value;
+				modified = true;
+			}
+		}
+
+		// Methods
+		
+		public override bool Equals (object rparam) 
+		{
+			return (rparam == null) ? false : this.Uri.Equals (rparam.ToString ());
+		}
+		
+		public override int GetHashCode ()
+		{
+			return this.Uri.GetHashCode ();
+		}
+		
+		public override string ToString ()
+		{
+			StringBuilder builder = new StringBuilder ();
+
+			builder.Append (scheme);
+			// note: mailto and news use ':', not "://", as their delimiter
+			builder.Append (Uri.GetSchemeDelimiter (scheme));
+
+			if (username != String.Empty) {
+				builder.Append (username);
+				if (password != String.Empty)
+					builder.Append (":" + password);
+				builder.Append ('@');
+			}
+
+			if (host.Length > 0) {
+				builder.Append (host);
+				if (port > 0)
+					builder.Append (":" + port);
+			}
+
+			if (path != String.Empty &&
+			    builder [builder.Length - 1] != '/' &&
+			    path.Length > 0 && path [0] != '/')
+				builder.Append ('/');
+			builder.Append (path);
+			builder.Append (query);
+			builder.Append (fragment);
+
+			return builder.ToString ();
+		}
+	}
+}

+ 41 - 59
mcs/class/System/Test/System/UriBuilderTest.cs

@@ -6,6 +6,7 @@
 //   Martin Willemoes Hansen ([email protected])
 //
 // (C) 2003 Martin Willemoes Hansen
+// Copyright (C) 2010 Novell, Inc (http://www.novell.com)
 //
 
 using NUnit.Framework;
@@ -29,11 +30,7 @@ namespace MonoTests.System
 		{
 			b = new UriBuilder ();
 			Assert.AreEqual ("http", b.Scheme, "#1");
-#if NET_2_0
 			Assert.AreEqual ("localhost", b.Host, "#2");
-#else
-			Assert.AreEqual ("loopback", b.Host, "#3");
-#endif
 			Assert.AreEqual (-1, b.Port, "#4");
 			Assert.AreEqual (string.Empty, b.Query, "#5");
 			Assert.AreEqual (string.Empty, b.Fragment, "#6");
@@ -61,23 +58,16 @@ namespace MonoTests.System
 			Assert.AreEqual (80, b.Port, "#B5");
 			Assert.AreEqual ("?name=50", b.Query, "#B5");
 			Assert.AreEqual ("http", b.Scheme, "#B6");
-#if NET_2_0
-			// our 1.0 behavior matches that of .NET 2.0
 			Assert.AreEqual ("http://www.ximian.com/?name=50#test", b.Uri.ToString (), "#B7");
-#endif
 			Assert.AreEqual (string.Empty, b.UserName, "#B8");
 		}
 
 		[Test] // ctor (string)
-#if ONLY_1_1
-		[Category ("NotWorking")] // we always throw an ArgumentNullException
-#endif
 		public void Constructor1_Uri_Null ()
 		{
 			try {
 				new UriBuilder ((string) null);
 				Assert.Fail ("#1");
-#if NET_2_0
 			} catch (ArgumentNullException ex) {
 				Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#2");
 				Assert.IsNull (ex.InnerException, "#3");
@@ -85,14 +75,14 @@ namespace MonoTests.System
 				Assert.IsNotNull (ex.ParamName, "#5");
 				Assert.AreEqual ("uriString", ex.ParamName, "#6");
 			}
-#else
-			} catch (NullReferenceException) {
-			}
-#endif
 		}
 
 		[Test] // ctor (Uri)
+#if NET_4_0
+		[ExpectedException (typeof (ArgumentNullException))]
+#else
 		[ExpectedException (typeof (NullReferenceException))]
+#endif
 		public void Constructor2_Uri_Null ()
 		{
 			new UriBuilder ((Uri) null);
@@ -113,24 +103,28 @@ namespace MonoTests.System
 		}
 		
 		[Test]
-		// This test does not make sense, will fix soon
-		[Category ("NotWorking")] // bug #75144
 		public void UserInfo ()
 		{
-			b = new UriBuilder ("mailto://myname:[email protected]?subject=hello");
-#if NET_2_0
-			Assert.AreEqual (string.Empty, b.UserName, "#1");
-			Assert.AreEqual (string.Empty, b.Password, "#2");
-#else
-			// NotWorking here for 1.x (bad behaviour in 1.x - may not be worth fixing)
-			Assert.AreEqual ("myname", b.UserName, "#1");
-			Assert.AreEqual ("mypwd", b.Password, "#2");
-#endif			
+			string s = "mailto://myname:[email protected]?subject=hello";
+			b = new UriBuilder (s);
+			Assert.AreEqual (s, b.ToString (), "1.ToString");
+			Assert.AreEqual (string.Empty, b.UserName, "1.UserName");
+			Assert.AreEqual (string.Empty, b.Password, "1.Password");
+			Assert.AreEqual ("//myname:[email protected]", b.Uri.LocalPath, "1.Uri.LocalPath");
+
+			// weird ?caching? issue, UserInfo is not updated if we look at the value of UserName before setting Password
 			b = new UriBuilder ("mailto", "contoso.com");
 			b.UserName = "myname";
+			Assert.AreEqual ("myname", b.Uri.UserInfo, "2.UserName");
 			b.Password = "mypwd";
-			// NotWorking here for 2.0 - worth fixing
-			Assert.AreEqual ("myname:mypwd", b.Uri.UserInfo, "#3");
+			Assert.AreEqual ("myname", b.Uri.UserInfo, "2.Password");
+			Assert.AreEqual ("/", b.Uri.LocalPath, "2.Uri.LocalPath");
+
+			b = new UriBuilder ("mailto", "contoso.com");
+			b.UserName = "myname";
+			b.Password = "mypwd";
+			Assert.AreEqual ("myname:mypwd", b.Uri.UserInfo, "3.Uri.UserInfo");
+			Assert.AreEqual ("/", b.Uri.LocalPath, "3.Uri.LocalPath");
 		}
 
 		[Test]
@@ -146,7 +140,7 @@ namespace MonoTests.System
 		{
 			b.Port = -12345;
 		}
-#if NET_2_0
+
 		[Test]
 		public void DefaultPort ()
 		{
@@ -154,14 +148,7 @@ namespace MonoTests.System
 			Assert.AreEqual (-1, b.Port, "#1");
 			Assert.AreEqual ("http://www.ximian.com/foo/bar/index.html", b.ToString (), "#2");
 		}
-#else
-		[Test]
-		[ExpectedException (typeof (ArgumentOutOfRangeException))]
-		public void BadPort3 ()
-		{
-			b.Port = -1;
-		}
-#endif
+
 		[Test]
 		public void Query ()
 		{
@@ -175,20 +162,12 @@ namespace MonoTests.System
 			b.Fragment = "test";
 			Assert.AreEqual ("#test", b.Fragment, "#5");
 			b.Query = "name";
-#if NET_2_0
 			Assert.AreEqual ("#test", b.Fragment, "#6");
-#else
-			Assert.AreEqual (string.Empty, b.Fragment, "#6");
-#endif
 			Assert.AreEqual ("?name", b.Query, "#7");
 			b.Fragment = "run";
 			Assert.AreEqual ("#run", b.Fragment, "#8");
 			b.Query = null;
-#if NET_2_0
 			Assert.AreEqual ("#run", b.Fragment, "#9");
-#else
-			Assert.AreEqual (string.Empty, b.Fragment, "#9");
-#endif
 			Assert.AreEqual (string.Empty, b.Query, "#10");
 		}
 		
@@ -205,11 +184,7 @@ namespace MonoTests.System
 			b.Query = "name";
 			Assert.AreEqual ("?name", b.Query, "#5");
 			b.Fragment = null;
-#if NET_2_0
 			Assert.AreEqual ("?name", b.Query, "#6");
-#else
-			Assert.AreEqual (string.Empty, b.Query, "#6");
-#endif
 			Assert.AreEqual (string.Empty, b.Fragment, "#7");
 		}
 		
@@ -233,25 +208,22 @@ namespace MonoTests.System
 		}
 		
 		[Test]
-#if NET_2_0
-		[Category ("NotWorking")] // equals changed in 2.0
-#endif
 		public void Equals ()
 		{
 			b = new UriBuilder ("http://", "www.ximian.com", 80, "foo/bar/index.html?item=1");
+			Assert.AreEqual ("foo/bar/index.html%3Fitem=1", b.Path, "1.Path");
+			Assert.AreEqual ("http://www.ximian.com:80/foo/bar/index.html%3Fitem=1", b.ToString (), "1.ToString");
+
 			b2 = new UriBuilder ("http", "www.ximian.com", 80, "/foo/bar/index.html", "?item=1");
+			Assert.AreEqual ("http://www.ximian.com:80/foo/bar/index.html?item=1", b2.ToString (), "2.ToString");
+
 			b3 = new UriBuilder (new Uri ("http://www.ximian.com/foo/bar/index.html?item=1"));
-#if NET_2_0
+			Assert.AreEqual ("http://www.ximian.com:80/foo/bar/index.html?item=1", b3.ToString (), "3.ToString");
+
 			Assert.IsFalse (b.Equals (b2), "#1");
 			Assert.IsFalse (b.Uri.Equals (b2.Uri), "#2");
 			Assert.IsFalse (b.Equals (b3), "#3");
 			Assert.IsFalse (b3.Equals (b), "#4");
-#else
-			Assert.IsTrue (b.Equals (b2), "#1");
-			Assert.IsTrue (b.Uri.Equals (b2.Uri), "#2");
-			Assert.IsTrue (b.Equals (b3), "#3");
-			Assert.IsTrue (b3.Equals (b), "#4");
-#endif
 			Assert.IsTrue (b2.Equals (b3), "#5");
 		}
 		
@@ -293,6 +265,16 @@ namespace MonoTests.System
 			Assert.AreEqual ("#Features", uri.Fragment, "#1");
 			Assert.AreEqual ("http://www.mono-project.com/Main_Page#Features", uri.Uri.ToString (), "#2");
 		}
+
+		[Test]
+		public void IPv6_Host ()
+		{
+			UriBuilder ub = new UriBuilder ("http", "[1:2:3:4:5:6:7:8]", 8080, "/dir/subdir/file");
+			Assert.AreEqual ("[1:2:3:4:5:6:7:8]", ub.Host, "Host.1");
+			Assert.AreEqual ("[0001:0002:0003:0004:0005:0006:0007:0008]", ub.Uri.Host, "Uri.Host");
+			// once the Uri is created then some builder properties may change
+			Assert.AreEqual ("[0001:0002:0003:0004:0005:0006:0007:0008]", ub.Host, "Host.2");
+		}
 	}
 }
 

+ 56 - 18
mcs/class/System/Test/System/UriTest2.cs

@@ -10,7 +10,6 @@ using NUnit.Framework;
 
 namespace MonoTests.System
 {
-#if NET_2_0
 	// help bring Moonlight tests back to mono/mcs nunit
 
 	public delegate void TestCode ();
@@ -43,7 +42,7 @@ namespace MonoTests.System
 				throw new AssertionException (string.Format ("Expected '{0}', but got no exception. {1}", expected_exception.FullName, message));
 		}
 	}
-#endif
+
 	[TestFixture]
 	public class UriTest2
 	{
@@ -97,9 +96,7 @@ namespace MonoTests.System
 		}
 
 		[Test]
-#if NET_2_0
 		[Ignore ("Tests needs to be updated for 2.0")]
-#endif
 		public void AbsoluteUriFromFile ()
 		{
 			FromResource ("test-uri-props.txt", null);
@@ -107,9 +104,7 @@ namespace MonoTests.System
 		
 		[Test]
 		[Category("NotDotNet")]
-#if NET_2_0
 		[Ignore ("Tests needs to be updated for 2.0")]
-#endif
 		public void AbsoluteUriFromFileManual ()
 		{
 			if (Path.DirectorySeparatorChar == '\\')
@@ -118,9 +113,7 @@ namespace MonoTests.System
 		}
 		
 		[Test]
-#if NET_2_0
 		[Ignore ("Tests needs to be updated for 2.0")]
-#endif
 		public void RelativeUriFromFile ()
 		{
 			FromResource ("test-uri-relative-props.txt", new Uri ("http://www.go-mono.com"));
@@ -209,10 +202,8 @@ TextWriter sw = Console.Out;
 			Assert.AreEqual ("mailto", Uri.UriSchemeMailto, "mailto");
 			Assert.AreEqual ("news", Uri.UriSchemeNews, "news");
 			Assert.AreEqual ("nntp", Uri.UriSchemeNntp, "file");
-#if NET_2_0
 			Assert.AreEqual ("net.pipe", Uri.UriSchemeNetPipe, "net.pipe");
 			Assert.AreEqual ("net.tcp", Uri.UriSchemeNetTcp, "net.tcp");
-#endif
 		}
 
 		[Test] // bug #71049
@@ -223,9 +214,6 @@ TextWriter sw = Console.Out;
 		}
 
 		[Test]
-#if ONLY_1_1
-		[Category ("NotDotNet")] // 1.x throws an UriFormatException
-#endif
 		public void NoHostName1_Bug76146 ()
 		{
 			Uri u = new Uri ("foo:///?bar");
@@ -248,9 +236,6 @@ TextWriter sw = Console.Out;
 		}
 
 		[Test]
-#if ONLY_1_1
-		[Category ("NotDotNet")] // 1.x throws an UriFormatException
-#endif
 		public void NoHostName2_Bug76146 ()
 		{
 			Uri u = new Uri ("foo:///bar");
@@ -278,7 +263,7 @@ TextWriter sw = Console.Out;
 		{
 			new Uri ("http://127.0.0.1::::/");
 		}
-#if NET_2_0
+
 		[Test]
 		public void File ()
 		{
@@ -548,7 +533,6 @@ TextWriter sw = Console.Out;
 			Assert.AreEqual (uri.Port.ToString (), uri.GetComponents (UriComponents.StrongPort, UriFormat.Unescaped), "StrongPort");
 			Assert.AreEqual (uri.UserInfo, uri.GetComponents (UriComponents.UserInfo, UriFormat.Unescaped), "UserInfo");
 		}
-#endif
 
 		[Test]
 		public void Merge_Query_Fragment ()
@@ -724,6 +708,16 @@ TextWriter sw = Console.Out;
 			Assert.AreEqual (String.Empty, uri.Host, "4/Host");
 			Assert.AreEqual ("//host/dir/subdir/file", uri.AbsolutePath, "4/AbsolutePath");
 			Assert.AreEqual ("//host/dir/subdir/file", uri.LocalPath, "4/LocalPath");
+
+			// query and fragment
+			uri = new Uri ("mono://host/dir/subdir/file?query#fragment");
+			Assert.AreEqual ("/dir/subdir/file", uri.AbsolutePath, "qf.AbsolutePath");
+			Assert.AreEqual ("?query", uri.Query, "qf.Query");
+			Assert.AreEqual ("#fragment", uri.Fragment, "qf.Fragment");
+
+			// special characters
+			uri = new Uri ("mono://host/<>%\"{}|\\^`;/:@&=+$,[]#abc");
+			Assert.AreEqual ("/%3C%3E%25%22%7B%7D%7C/%5E%60;/:@&=+$,%5B%5D", uri.AbsolutePath, "Special");
 		}
 
 		[Test]
@@ -841,5 +835,49 @@ TextWriter sw = Console.Out;
 			Assert.AreEqual ("/%3C%3E%25%22%7B%7D%7C/%5E%60;/%3F:@&=+$,%5B%5D", uri.AbsolutePath, "Special");
 			Assert.AreEqual ("#abc", uri.Fragment, "Special/Fragment");
 		}
+
+		[Test]
+		public void FileScheme ()
+		{
+			Uri uri = new Uri ("file://host/dir/subdir/file?this-is-not-a-query#but-this-is-a-fragment");
+			Assert.AreEqual ("/dir/subdir/file%3Fthis-is-not-a-query", uri.AbsolutePath, "AbsolutePath");
+			Assert.AreEqual ("file://host/dir/subdir/file%3Fthis-is-not-a-query#but-this-is-a-fragment", uri.AbsoluteUri, "AbsoluteUri");
+			Assert.AreEqual ("host", uri.Authority, "Authority");
+			Assert.AreEqual ("host", uri.DnsSafeHost, "DnsSafeHost");
+			Assert.AreEqual ("#but-this-is-a-fragment", uri.Fragment, "Fragment");
+			Assert.AreEqual ("host", uri.Host, "Host");
+			Assert.AreEqual (UriHostNameType.Dns, uri.HostNameType, "HostNameType");
+			Assert.IsTrue (uri.IsAbsoluteUri, "IsAbsoluteUri");
+			Assert.IsTrue (uri.IsDefaultPort, "IsDefaultPort");
+			Assert.IsTrue (uri.IsFile, "IsFile");
+			Assert.IsFalse (uri.IsLoopback, "IsLoopback");
+			Assert.IsTrue (uri.IsUnc, "IsUnc");
+			Assert.AreEqual (isWin32 ? "\\\\host\\dir\\subdir\\file?this-is-not-a-query" : "/dir/subdir/file?this-is-not-a-query", uri.LocalPath, "LocalPath");
+			Assert.AreEqual ("file://host/dir/subdir/file?this-is-not-a-query#but-this-is-a-fragment", uri.OriginalString, "OriginalString");
+			Assert.AreEqual ("/dir/subdir/file%3Fthis-is-not-a-query", uri.PathAndQuery, "PathAndQuery");
+			Assert.AreEqual (-1, uri.Port, "Port");
+			Assert.AreEqual (String.Empty, uri.Query, "Query");
+			Assert.AreEqual ("file", uri.Scheme, "Scheme");
+			Assert.AreEqual ("/", uri.Segments [0], "Segments [0]");
+			Assert.AreEqual ("dir/", uri.Segments [1], "Segments [1]");
+			Assert.AreEqual ("subdir/", uri.Segments [2], "Segments [2]");
+			Assert.AreEqual ("file%3Fthis-is-not-a-query", uri.Segments [3], "Segments [3]");
+			Assert.IsFalse (uri.UserEscaped, "UserEscaped");
+			Assert.AreEqual (String.Empty, uri.UserInfo, "UserInfo");
+
+			// special characters
+			uri = new Uri ("file://host/<>%\"{}|\\^`;/?:@&=+$,[]#abc");
+			Assert.AreEqual ("/%3C%3E%25%22%7B%7D%7C/%5E%60;/%3F:@&=+$,%5B%5D", uri.AbsolutePath, "Special");
+		}
+
+		[Test]
+		public void PathReduction_2e ()
+		{
+			Uri uri = new Uri ("http://host/dir/%2e%2E/file");
+			Assert.AreEqual ("/file", uri.AbsolutePath, "AbsolutePath");
+			Assert.AreEqual ("http://host/file", uri.AbsoluteUri, "AbsoluteUri");
+			Assert.AreEqual ("/", uri.Segments [0], "Segments [0]");
+			Assert.AreEqual ("file", uri.Segments [1], "Segments [1]");
+		}
 	}
 }

+ 5 - 22
mcs/class/System/Test/System/UriTest3.cs

@@ -26,8 +26,6 @@
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 //
 
-#if NET_2_0
-
 using NUnit.Framework;
 
 using System;
@@ -213,7 +211,6 @@ namespace MonoTests.System
 		}
 
 		[Test] // TryCreate (Uri, String, Uri)
-		[Category ("NotWorking")]
 		public void TryCreate2 ()
 		{
 			Uri baseUri = new Uri (absolute);
@@ -253,7 +250,6 @@ namespace MonoTests.System
 		}
 
 		[Test] // TryCreate (Uri, Uri, Uri)
-		[Category ("NotWorking")]
 		public void TryCreate3 ()
 		{
 			Uri baseUri = new Uri (absolute);
@@ -477,36 +473,24 @@ namespace MonoTests.System
 		}
 
 		[Test]
-		[Category ("NotDotNet")] // https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=299942
-		public void MakeRelativeUri_Uri_Null_Mono ()
+		public void MakeRelativeUri_Uri_Null ()
 		{
 			Uri uri = new Uri ("http://test.com");
 			try {
 				uri.MakeRelativeUri ((Uri) null);
 				Assert.Fail ("#1");
-			} catch (ArgumentNullException ex) {
+			}
+#if NET_4_0
+			catch (ArgumentNullException ex) {
 				Assert.AreEqual (typeof (ArgumentNullException), ex.GetType (), "#2");
 				Assert.IsNull (ex.InnerException, "#3");
 				Assert.IsNotNull (ex.Message, "#4");
 				Assert.IsNotNull (ex.ParamName, "#5");
 				Assert.AreEqual ("uri", ex.ParamName, "#6");
 			}
-		}
-
-		[Test]
-		[Category ("NotWorking")] // https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=299942
-		public void MakeRelativeUri_Uri_Null_MS ()
-		{
-			Uri uri = new Uri ("http://test.com");
-			try {
-				uri.MakeRelativeUri ((Uri) null);
-				Assert.Fail ("#1");
-			}
-#if NET_4_0
-			catch (ArgumentNullException) {
-			}
 #else
 			catch (NullReferenceException) {
+				// https://connect.microsoft.com/VisualStudio/feedback/ViewFeedback.aspx?FeedbackID=299942
 			}
 #endif
 		}
@@ -643,4 +627,3 @@ namespace MonoTests.System
 	}
 }
 
-#endif

+ 1 - 1
mcs/tools/Makefile

@@ -20,7 +20,6 @@ net_4_0_dirs := \
 	$(per_profile_dirs) \
 	corcompare	\
 	mono-xmltool	\
-	mdoc		\
 	mono-shlib-cop	\
 	sgen		\
 	mconfig		\
@@ -47,6 +46,7 @@ net_4_0_dirs := \
 net_2_0_dirs := \
 	$(per_profile_dirs) \
 	monodoc		\
+	mdoc		\
 	compiler-tester
 
 moonlight_dirs := \

+ 1 - 1
mcs/tools/mdoc/Makefile

@@ -15,7 +15,7 @@ MDOC_COMMON_FLAGS = \
 	/r:System.Web.dll                                                           \
 	/r:System.Xml.Linq.dll                                                      \
 	/r:ICSharpCode.SharpZipLib.dll                                              \
-	/r:$(topdir)/class/lib/net_4_0/Mono.Cecil.dll
+	/r:Mono.Cecil.dll
 
 LOCAL_MCS_FLAGS = $(MDOC_COMMON_FLAGS) \
 	/r:$(topdir)/class/lib/net_2_0/monodoc.dll

+ 61 - 38
mono-core.spec.in

@@ -7,20 +7,17 @@
 %define sgen no
 %endif
 
-%if %llvm == yes
-%define enable_llvm --enable-loadedllvm
-%endif
-
 Name:           mono-core
 License:        LGPL v2.1 only
 Group:          Development/Languages/Mono
 Summary:        A .NET Runtime Environment
 Url:            http://www.mono-project.com
 Version:        @VERSION@
-Release:        30
+Release:        0
 Source0:        mono-%{version}.tar.bz2
 BuildRequires:  bison
 BuildRequires:  gcc-c++
+BuildRequires:  fdupes
 BuildRequires:  pkgconfig
 BuildRequires:  zlib-devel
 %ifnarch ia64
@@ -95,9 +92,12 @@ export CFLAGS=" $RPM_OPT_FLAGS -fno-strict-aliasing"
 export PATH=/opt/novell/llvm-mono/bin:$PATH
 %endif
 %configure \
-  --with-ikvm=yes \
   --with-sgen=%{sgen} \
-  %{?enable_llvm} \
+%if %llvm == yes
+  --enable-loadedllvm \
+  --disable-system-aot \
+%endif
+  --with-ikvm=yes \
   --with-moonlight=no
 make # We are not -jN safe! %{?jobs:-j%jobs}
 
@@ -122,9 +122,10 @@ rm -f %buildroot%_prefix/lib/mono/*/culevel.exe*
 rm -f %buildroot%_prefix/lib/mono/2.0/cilc.exe*
 # brp-compress doesn't search _mandir
 # so we cheat it
-ln -s . %buildroot%_prefix/usr
+ln -s . %buildroot%_prefix%_prefix
 RPM_BUILD_ROOT=%buildroot%_prefix /usr/lib/rpm/brp-compress
-rm %buildroot%_prefix/usr
+rm %buildroot%_prefix%_prefix
+%fdupes %buildroot%_prefix
 %find_lang mcs
 
 %clean
@@ -148,6 +149,8 @@ rm -rf %buildroot
 %dir %_sysconfdir/mono
 %dir %_sysconfdir/mono/2.0
 %dir %_sysconfdir/mono/4.0
+%_bindir/al
+%_bindir/al2
 %_bindir/certmgr
 %_bindir/chktrust
 %_bindir/csharp
@@ -204,6 +207,7 @@ rm -rf %buildroot
 %_prefix/lib/mono/2.0/System.Xml.Linq.dll
 %_prefix/lib/mono/2.0/System.Xml.dll
 %_prefix/lib/mono/2.0/System.dll
+%_prefix/lib/mono/2.0/al.exe*
 %_prefix/lib/mono/2.0/cscompmgd.dll
 %_prefix/lib/mono/2.0/csharp.exe*
 %_prefix/lib/mono/2.0/gacutil.exe*
@@ -236,6 +240,7 @@ rm -rf %buildroot
 %_prefix/lib/mono/4.0/System.Xml.Linq.dll
 %_prefix/lib/mono/4.0/System.Xml.dll
 %_prefix/lib/mono/4.0/System.dll
+%_prefix/lib/mono/4.0/al.exe*
 %_prefix/lib/mono/4.0/certmgr.exe*
 %_prefix/lib/mono/4.0/chktrust.exe*
 %_prefix/lib/mono/4.0/cscompmgd.dll
@@ -306,6 +311,7 @@ A Library for embedding Mono in your Application.
 License:        LGPL v2.1 only
 Summary:	Development files for libmono
 Group:          Development/Languages/Mono
+Requires:       mono-core == %version-%release
 
 %description -n libmono-2_0-devel
 The Mono Project is an open development initiative that is working to
@@ -350,6 +356,7 @@ A Library for embedding Mono in your Application (sgen version).
 License:        LGPL v2.1 only
 Summary:	Development files for libmonosgen
 Group:          Development/Languages/Mono
+Requires:       mono-core == %version-%release
 
 %description -n libmonosgen-2_0-devel
 The Mono Project is an open development initiative that is working to
@@ -459,19 +466,19 @@ Database connectivity for Mono.
 %_prefix/lib/mono/2.0/Novell.Directory.Ldap.dll
 %_prefix/lib/mono/2.0/System.Data.DataSetExtensions.dll
 %_prefix/lib/mono/2.0/System.Data.Linq.dll
-%_prefix/lib/mono/2.0/System.Data.Services.dll
 %_prefix/lib/mono/2.0/System.Data.dll
 %_prefix/lib/mono/2.0/System.DirectoryServices.dll
 %_prefix/lib/mono/2.0/System.EnterpriseServices.dll
+%_prefix/lib/mono/2.0/System.Runtime.Serialization.dll
 %_prefix/lib/mono/2.0/System.Transactions.dll
 %_prefix/lib/mono/4.0/Mono.Data.Tds.dll
 %_prefix/lib/mono/4.0/Novell.Directory.Ldap.dll
 %_prefix/lib/mono/4.0/System.Data.DataSetExtensions.dll
 %_prefix/lib/mono/4.0/System.Data.Linq.dll
-%_prefix/lib/mono/4.0/System.Data.Services.dll
 %_prefix/lib/mono/4.0/System.Data.dll
 %_prefix/lib/mono/4.0/System.DirectoryServices.dll
 %_prefix/lib/mono/4.0/System.EnterpriseServices.dll
+%_prefix/lib/mono/4.0/System.Runtime.Serialization.dll
 %_prefix/lib/mono/4.0/System.Transactions.dll
 %_prefix/lib/mono/4.0/sqlmetal.exe*
 %_prefix/lib/mono/4.0/sqlsharp.exe*
@@ -480,9 +487,9 @@ Database connectivity for Mono.
 %_prefix/lib/mono/gac/System.Data
 %_prefix/lib/mono/gac/System.Data.DataSetExtensions
 %_prefix/lib/mono/gac/System.Data.Linq
-%_prefix/lib/mono/gac/System.Data.Services
 %_prefix/lib/mono/gac/System.DirectoryServices
 %_prefix/lib/mono/gac/System.EnterpriseServices
+%_prefix/lib/mono/gac/System.Runtime.Serialization
 %_prefix/lib/mono/gac/System.Transactions
 
 %package -n mono-winforms
@@ -652,31 +659,28 @@ Mono implementation of WCF, Windows Communication Foundation
 %defattr(-, root, root)
 %_bindir/svcutil
 %_libdir/pkgconfig/wcf.pc
+%_prefix/lib/mono/2.0/System.Data.Services.dll
 %_prefix/lib/mono/2.0/System.IdentityModel.Selectors.dll
 %_prefix/lib/mono/2.0/System.IdentityModel.dll
-%_prefix/lib/mono/2.0/System.Runtime.Serialization.dll
 %_prefix/lib/mono/2.0/System.ServiceModel.Web.dll
 %_prefix/lib/mono/2.0/System.ServiceModel.dll
+%_prefix/lib/mono/4.0/System.Data.Services.dll
 %_prefix/lib/mono/4.0/System.IdentityModel.Selectors.dll
 %_prefix/lib/mono/4.0/System.IdentityModel.dll
 %_prefix/lib/mono/4.0/System.Runtime.DurableInstancing.dll
-%_prefix/lib/mono/4.0/System.Runtime.Serialization.dll
 %_prefix/lib/mono/4.0/System.ServiceModel.Discovery.dll
 %_prefix/lib/mono/4.0/System.ServiceModel.Routing.dll
 %_prefix/lib/mono/4.0/System.ServiceModel.Web.dll
 %_prefix/lib/mono/4.0/System.ServiceModel.dll
-%_prefix/lib/mono/4.0/System.Web.ApplicationServices.dll
 %_prefix/lib/mono/4.0/svcutil.exe*
-%_prefix/lib/mono/gac/System.Data.Services.Client
+%_prefix/lib/mono/gac/System.Data.Services
 %_prefix/lib/mono/gac/System.IdentityModel
 %_prefix/lib/mono/gac/System.IdentityModel.Selectors
 %_prefix/lib/mono/gac/System.Runtime.DurableInstancing
-%_prefix/lib/mono/gac/System.Runtime.Serialization
 %_prefix/lib/mono/gac/System.ServiceModel
 %_prefix/lib/mono/gac/System.ServiceModel.Discovery
 %_prefix/lib/mono/gac/System.ServiceModel.Routing
 %_prefix/lib/mono/gac/System.ServiceModel.Web
-%_prefix/lib/mono/gac/System.Web.ApplicationServices
 
 %package -n mono-winfxcore
 License:        MIT License (or similar) ; Ms-Pl
@@ -697,6 +701,7 @@ Mono implementation of core WinFX APIs
 %defattr(-, root, root)
 %_prefix/lib/mono/2.0/WindowsBase.dll*
 %_prefix/lib/mono/4.0/WindowsBase.dll*
+%_prefix/lib/mono/gac/System.Data.Services.Client
 %_prefix/lib/mono/gac/WindowsBase
 
 %package -n mono-web
@@ -742,10 +747,6 @@ Mono implementation of ASP.NET, Remoting and Web Services.
 %_bindir/wsdl2
 %_bindir/xsd
 %_libdir/pkgconfig/mono.web.pc
-%_libdir/pkgconfig/system.web.extensions.design_1.0.pc
-%_libdir/pkgconfig/system.web.extensions_1.0.pc
-%_libdir/pkgconfig/system.web.mvc.pc
-%_libdir/pkgconfig/system.web.mvc2.pc
 %_mandir/man1/disco.1%ext_man
 %_mandir/man1/mconfig.1%ext_man
 %_mandir/man1/soapsuds.1%ext_man
@@ -758,9 +759,6 @@ Mono implementation of ASP.NET, Remoting and Web Services.
 %_prefix/lib/mono/2.0/System.Runtime.Serialization.Formatters.Soap.dll
 %_prefix/lib/mono/2.0/System.Web.Abstractions.dll
 %_prefix/lib/mono/2.0/System.Web.DynamicData.dll
-%_prefix/lib/mono/2.0/System.Web.Extensions.Design.dll
-%_prefix/lib/mono/2.0/System.Web.Extensions.dll
-%_prefix/lib/mono/2.0/System.Web.Mvc.dll
 %_prefix/lib/mono/2.0/System.Web.Routing.dll
 %_prefix/lib/mono/2.0/System.Web.Services.dll
 %_prefix/lib/mono/2.0/System.Web.dll
@@ -773,9 +771,8 @@ Mono implementation of ASP.NET, Remoting and Web Services.
 %_prefix/lib/mono/4.0/System.Runtime.Remoting.dll
 %_prefix/lib/mono/4.0/System.Runtime.Serialization.Formatters.Soap.dll
 %_prefix/lib/mono/4.0/System.Web.Abstractions.dll
+%_prefix/lib/mono/4.0/System.Web.ApplicationServices.dll
 %_prefix/lib/mono/4.0/System.Web.DynamicData.dll
-%_prefix/lib/mono/4.0/System.Web.Extensions.Design.dll
-%_prefix/lib/mono/4.0/System.Web.Extensions.dll
 %_prefix/lib/mono/4.0/System.Web.Routing.dll
 %_prefix/lib/mono/4.0/System.Web.Services.dll
 %_prefix/lib/mono/4.0/System.Web.dll
@@ -784,9 +781,6 @@ Mono implementation of ASP.NET, Remoting and Web Services.
 %_prefix/lib/mono/4.0/soapsuds.exe*
 %_prefix/lib/mono/4.0/wsdl.exe*
 %_prefix/lib/mono/4.0/xsd.exe*
-%_prefix/lib/mono/compat-2.0/System.Web.Extensions.Design.dll
-%_prefix/lib/mono/compat-2.0/System.Web.Extensions.dll
-%_prefix/lib/mono/compat-2.0/System.Web.Mvc.dll
 %_prefix/lib/mono/gac/Mono.Http
 %_prefix/lib/mono/gac/Mono.Web
 %_prefix/lib/mono/gac/System.ComponentModel.Composition
@@ -795,12 +789,44 @@ Mono implementation of ASP.NET, Remoting and Web Services.
 %_prefix/lib/mono/gac/System.Runtime.Serialization.Formatters.Soap
 %_prefix/lib/mono/gac/System.Web
 %_prefix/lib/mono/gac/System.Web.Abstractions
+%_prefix/lib/mono/gac/System.Web.ApplicationServices
 %_prefix/lib/mono/gac/System.Web.DynamicData
+%_prefix/lib/mono/gac/System.Web.Routing
+%_prefix/lib/mono/gac/System.Web.Services
+
+%package -n mono-mvc
+License:        MIT License (or similar) ; Ms-Pl
+Summary:        Mono implementation of ASP.NET MVC
+Group:          Development/Languages/Mono
+Requires:       mono-core == %version-%release
+
+%description -n mono-mvc
+The Mono Project is an open development initiative that is working to
+develop an open source, Unix version of the .NET development platform.
+Its objective is to enable Unix developers to build and deploy
+cross-platform .NET applications. The project will implement various
+technologies that have been submitted to the ECMA for standardization.
+
+Mono implementation of ASP.NET MVC.
+
+%files -n mono-mvc
+%defattr(-, root, root)
+%_libdir/pkgconfig/system.web.extensions.design_1.0.pc
+%_libdir/pkgconfig/system.web.extensions_1.0.pc
+%_libdir/pkgconfig/system.web.mvc.pc
+%_libdir/pkgconfig/system.web.mvc2.pc
+%_prefix/lib/mono/2.0/System.Web.Extensions.Design.dll
+%_prefix/lib/mono/2.0/System.Web.Extensions.dll
+%_prefix/lib/mono/2.0/System.Web.Mvc.dll
+%_prefix/lib/mono/3.5/System.Web.Extensions.Design.dll
+%_prefix/lib/mono/4.0/System.Web.Extensions.Design.dll
+%_prefix/lib/mono/4.0/System.Web.Extensions.dll
+%_prefix/lib/mono/compat-2.0/System.Web.Extensions.Design.dll
+%_prefix/lib/mono/compat-2.0/System.Web.Extensions.dll
+%_prefix/lib/mono/compat-2.0/System.Web.Mvc.dll
 %_prefix/lib/mono/gac/System.Web.Extensions
 %_prefix/lib/mono/gac/System.Web.Extensions.Design
 %_prefix/lib/mono/gac/System.Web.Mvc
-%_prefix/lib/mono/gac/System.Web.Routing
-%_prefix/lib/mono/gac/System.Web.Services
 
 %package -n mono-data-oracle
 License:        LGPL v2.1 only
@@ -932,8 +958,6 @@ Mono development tools.
 
 %files -n mono-devel
 %defattr(-, root, root)
-%_bindir/al
-%_bindir/al2
 %_bindir/caspol
 %_bindir/ccrewrite
 %_bindir/cert2spc
@@ -1024,7 +1048,6 @@ Mono development tools.
 %_prefix/lib/mono/2.0/Microsoft.VisualBasic.targets
 %_prefix/lib/mono/2.0/Mono.Debugger.Soft.dll
 %_prefix/lib/mono/2.0/PEAPI.dll
-%_prefix/lib/mono/2.0/al.exe*
 %_prefix/lib/mono/2.0/genxs.exe*
 %_prefix/lib/mono/2.0/ilasm.exe*
 %_prefix/lib/mono/2.0/mkbundle.exe*
@@ -1057,7 +1080,6 @@ Mono development tools.
 %_prefix/lib/mono/4.0/Microsoft.VisualBasic.targets
 %_prefix/lib/mono/4.0/Mono.CodeContracts.dll
 %_prefix/lib/mono/4.0/PEAPI.dll
-%_prefix/lib/mono/4.0/al.exe*
 %_prefix/lib/mono/4.0/caspol.exe*
 %_prefix/lib/mono/4.0/ccrewrite.exe*
 %_prefix/lib/mono/4.0/cert2spc.exe*
@@ -1103,6 +1125,7 @@ Mono development tools.
 License:        LGPL v2.1 only
 Summary:        Monodoc - Documentation tools for C# code
 Group:          Development/Tools/Other
+Requires:       mono-core == %version-%release
 Obsoletes:      monodoc
 Provides:       monodoc
 # Added to uncompress and compare documentation used by build-compare
@@ -1137,7 +1160,7 @@ Monodoc-core contains documentation tools for C#.
 %_mandir/man1/monodocer.1%ext_man
 %_mandir/man1/monodocs2html.1%ext_man
 %_mandir/man5/mdoc.5%ext_man
-%_prefix/lib/mono/4.0/mdoc.exe*
+%_prefix/lib/mono/2.0/mdoc.exe*
 %_prefix/lib/mono/4.0/mod.exe*
 %_prefix/lib/mono/gac/monodoc
 %_prefix/lib/mono/monodoc
@@ -1147,6 +1170,7 @@ Monodoc-core contains documentation tools for C#.
 License:        LGPL v2.1 only
 Summary:        Install everything built from the mono source tree
 Group:          Development/Languages/Mono
+Requires:       mono-core = %version-%release
 Requires:       ibm-data-db2 = %version-%release
 Requires:       libmono-2_0-1 = %version-%release
 Requires:       libmono-2_0-devel = %version-%release
@@ -1157,7 +1181,6 @@ Requires:       libmono-llvm0 = %version-%release
 Requires:       libmonosgen-2_0-0 = %version-%release
 Requires:       libmonosgen-2_0-devel = %version-%release
 %endif
-Requires:       mono-core = %version-%release
 Requires:       mono-data = %version-%release
 Requires:       mono-data-oracle = %version-%release
 Requires:       mono-data-postgresql = %version-%release

+ 13 - 7
mono/metadata/Makefile.am

@@ -28,21 +28,29 @@ unix_sources = \
 platform_sources = $(unix_sources)
 endif
 
+if SHARED_MONO
 bin_PROGRAMS = pedump
+endif
 
 #
 # libtool is not capable of creating static/shared versions of the same
 # convenience lib, so we have to do it ourselves
 #
 if SUPPORT_SGEN
-sgen_libraries = libmonoruntimesgen.la libmonoruntimesgen-static.la 
+if SHARED_MONO
+shared_sgen_libraries = libmonoruntimesgen.la 
+endif
+sgen_libraries = $(shared_sgen_libraries) libmonoruntimesgen-static.la 
 endif
 
 if MOONLIGHT
-moonlight_libraries = libmonoruntimemoon.la libmonoruntimemoon-static.la
+moonlight_libraries = libmonoruntimemoon.la
 endif
 
-noinst_LTLIBRARIES = libmonoruntime.la libmonoruntime-static.la $(sgen_libraries) $(moonlight_libraries)
+if SHARED_MONO
+shared_libraries = libmonoruntime.la
+endif
+noinst_LTLIBRARIES =  $(shared_libaries) libmonoruntime-static.la $(sgen_libraries) $(moonlight_libraries)
 
 INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/mono $(LIBGC_CFLAGS) $(GLIB_CFLAGS) -DMONO_BINDIR=\"$(bindir)/\" -DMONO_ASSEMBLIES=\"$(assembliesdir)\" -DMONO_CFG_DIR=\"$(confdir)\"
 
@@ -212,10 +220,6 @@ libmonoruntime_static_la_SOURCES = $(libmonoruntime_la_SOURCES)
 libmonoruntime_static_la_LDFLAGS = -static
 libmonoruntime_static_la_CFLAGS = $(BOEHM_DEFINES)
 
-libmonoruntimemoon_static_la_SOURCES = $(libmonoruntime_la_SOURCES)
-libmonoruntimemoon_static_la_LDFLAGS = -static
-libmonoruntimemoon_static_la_CFLAGS = $(MOONLIGHT_DEFINES) $(BOEHM_DEFINES)
-
 libmonoruntimesgen_static_la_SOURCES = $(libmonoruntime_la_SOURCES)
 libmonoruntimesgen_static_la_LDFLAGS = -static
 libmonoruntimesgen_static_la_CFLAGS = $(SGEN_DEFINES)
@@ -259,6 +263,7 @@ else
 PEDUMP_DTRACE_OBJECT = 
 endif
 
+if SHARED_MONO
 pedump_SOURCES =		\
 	pedump.c
 
@@ -268,6 +273,7 @@ pedump_LDADD = libmonoruntime.la ../io-layer/libwapi.la ../utils/libmonoutils.la
 if PLATFORM_DARWIN
 pedump_LDFLAGS=-framework CoreFoundation
 endif
+endif
 
 EXTRA_DIST = make-bundle.pl sample-bundle $(win32_sources) $(unix_sources) $(null_sources) $(sgen_sources) runtime.h
 

+ 18 - 2
mono/metadata/assembly.c

@@ -62,6 +62,7 @@ static char **assemblies_path = NULL;
 /* Contains the list of directories that point to auxiliary GACs */
 static char **extra_gac_paths = NULL;
 
+#ifndef DISABLE_ASSEMBLY_REMAPPING
 /* The list of system assemblies what will be remapped to the running
  * runtime version. WARNING: this list must be sorted.
  */
@@ -121,6 +122,7 @@ static const AssemblyVersionMap framework_assemblies [] = {
 	{"System.Xml", 0},
 	{"mscorlib", 0}
 };
+#endif
 
 /*
  * keeps track of loaded assemblies
@@ -796,6 +798,7 @@ mono_assembly_addref (MonoAssembly *assembly)
 	InterlockedIncrement (&assembly->ref_count);
 }
 
+#ifndef DISABLE_ASSEMBLY_REMAPPING
 static MonoAssemblyName *
 mono_assembly_remap_version (MonoAssemblyName *aname, MonoAssemblyName *dest_aname)
 {
@@ -844,6 +847,7 @@ mono_assembly_remap_version (MonoAssemblyName *aname, MonoAssemblyName *dest_ana
 	}
 	return aname;
 }
+#endif
 
 /*
  * mono_assembly_get_assemblyref:
@@ -2059,7 +2063,10 @@ MonoAssembly*
 mono_assembly_load_with_partial_name (const char *name, MonoImageOpenStatus *status)
 {
 	MonoAssembly *res;
-	MonoAssemblyName *aname, base_name, maped_aname;
+	MonoAssemblyName *aname, base_name;
+#ifndef DISABLE_ASSEMBLY_REMAPPING
+	MonoAssemblyName maped_aname;
+#endif
 	gchar *fullname, *gacpath;
 	gchar **paths;
 
@@ -2069,12 +2076,14 @@ mono_assembly_load_with_partial_name (const char *name, MonoImageOpenStatus *sta
 	if (!mono_assembly_name_parse (name, aname))
 		return NULL;
 
+#ifndef DISABLE_ASSEMBLY_REMAPPING
 	/* 
 	 * If no specific version has been requested, make sure we load the
 	 * correct version for system assemblies.
 	 */ 
 	if ((aname->major | aname->minor | aname->build | aname->revision) == 0)
 		aname = mono_assembly_remap_version (aname, &maped_aname);
+#endif
 	
 	res = mono_assembly_loaded (aname);
 	if (res) {
@@ -2598,12 +2607,17 @@ mono_assembly_load_full_nosearch (MonoAssemblyName *aname,
 {
 	MonoAssembly *result;
 	char *fullpath, *filename;
-	MonoAssemblyName maped_aname, maped_name_pp;
+#ifndef DISABLE_ASSEMBLY_REMAPPING
+	MonoAssemblyName maped_aname;
+#endif
+	MonoAssemblyName maped_name_pp;
 	int ext_index;
 	const char *ext;
 	int len;
 
+#ifndef DISABLE_ASSEMBLY_REMAPPING
 	aname = mono_assembly_remap_version (aname, &maped_aname);
+#endif
 	
 	/* Reflection only assemblies don't get assembly binding */
 	if (!refonly)
@@ -2714,9 +2728,11 @@ MonoAssembly*
 mono_assembly_loaded_full (MonoAssemblyName *aname, gboolean refonly)
 {
 	MonoAssembly *res;
+#ifndef DISABLE_ASSEMBLY_REMAPPING
 	MonoAssemblyName maped_aname;
 
 	aname = mono_assembly_remap_version (aname, &maped_aname);
+#endif
 
 	res = mono_assembly_invoke_search_hook_internal (aname, refonly, FALSE);
 

+ 6 - 6
mono/mini/Makefile.am

@@ -102,7 +102,11 @@ endif
 
 noinst_PROGRAMS = genmdesc
 
-lib_LTLIBRARIES = libmono-2.0.la $(sgen_libraries)
+if SHARED_MONO
+shared_libraries = libmono-2.0.la
+endif
+
+lib_LTLIBRARIES = $(shared_libraries) $(sgen_libraries)
 noinst_LTLIBRARIES = libmono-static.la $(sgen_static_libraries)
 
 if MOONLIGHT
@@ -497,6 +501,7 @@ libmonosgen_2_0_la_CFLAGS = $(AM_CFLAGS) $(SGEN_DEFINES)
 if MOONLIGHT
 libmono_moon_la_SOURCES = $(libmono_2_0_la_SOURCES)
 libmono_moon_la_CFLAGS = $(AM_CFLAGS) $(MOONLIGHT_DEFINES)
+libmono_moon_la_LIBADD = $(moon_libs) $(LIBMONO_DTRACE_OBJECT)
 endif
 
 libmono_static_la_SOURCES = $(libmono_2_0_la_SOURCES)
@@ -524,11 +529,6 @@ libmono_2_0_la_LIBADD = \
 libmonosgen_2_0_la_LIBADD = \
 	$(sgen_libs) $(LIBMONO_DTRACE_OBJECT)
 
-if MOONLIGHT
-libmono_moon_la_LIBADD = \
-	$(moon_libs) $(LIBMONO_DTRACE_OBJECT)
-endif
-
 basic-simd.exe: basic-simd.cs
 	$(MCS) -out:$@ $< -r:TestDriver.dll -r:Mono.Simd.dll
 

+ 1 - 1
scripts/Makefile.am

@@ -56,6 +56,7 @@ scripts_2_0 = \
 	csharp2$(SCRIPT_SUFFIX)			\
 	gacutil2$(SCRIPT_SUFFIX)		\
 	gmcs$(SCRIPT_SUFFIX)			\
+	mdoc$(SCRIPT_SUFFIX)                    \
 	monop2$(SCRIPT_SUFFIX) 			\
 	resgen2$(SCRIPT_SUFFIX)			\
 	wsdl2$(SCRIPT_SUFFIX)
@@ -68,7 +69,6 @@ scripts_4_0 = \
 	installvst$(SCRIPT_SUFFIX)		\
 	genxs$(SCRIPT_SUFFIX)			\
 	macpack$(SCRIPT_SUFFIX)			\
-	mdoc$(SCRIPT_SUFFIX)                    \
 	mono-cil-strip$(SCRIPT_SUFFIX)		\
 	prj2make$(SCRIPT_SUFFIX)		\
 	soapsuds$(SCRIPT_SUFFIX)		\