فهرست منبع

Switch to single mcs compiler for all managed code build

Marek Safar 15 سال پیش
والد
کامیت
49b0253a7f

+ 12 - 22
mcs/Makefile

@@ -3,18 +3,13 @@ thisdir := .
 SUBDIRS := build jay mcs class nunit24 ilasm tools tests errors docs
 
 basic_SUBDIRS := build jay mcs class tools
-net_2_0_bootstrap_SUBDIRS := build tools
-net_2_0_SUBDIRS := build mcs class nunit24 ilasm tools tests errors 
-moonlight_bootstrap_SUBDIRS := build mcs class
-moonlight_raw_SUBDIRS := build mcs class tools
-moonlight_SUBDIRS := tools tests errors
-monodroid_bootstrap_SUBDIRS := build mcs class
-monodroid_SUBDIRS := build mcs class
-monotouch_bootstrap_SUBDIRS := build mcs class
-monotouch_SUBDIRS := build mcs class
+net_2_0_SUBDIRS := build class nunit24 ilasm tools tests errors mcs
+moonlight_raw_SUBDIRS := build class tools mcs
+moonlight_SUBDIRS := tools
+monodroid_SUBDIRS := build class mcs
+monotouch_SUBDIRS := build class mcs
 net_3_5_SUBDIRS := build class tools/xbuild
-net_4_0_bootstrap_SUBDIRS := build mcs class tools 
-net_4_0_SUBDIRS := build mcs class nunit24 ilasm tools tests errors docs
+net_4_0_SUBDIRS := build class nunit24 ilasm tools tests errors docs mcs
 
 # List of test subdirs that should pass 100%
 centum_tests := \
@@ -105,18 +100,13 @@ profiles-do--run-test:
 
 # Orchestrate the bootstrap here.
 _boot_ = all clean install
-$(_boot_:%=profile-do--net_4_0--%):           profile-do--net_4_0--%:           profile-do--net_4_0_bootstrap--%
-$(_boot_:%=profile-do--net_4_0_bootstrap--%): profile-do--net_4_0_bootstrap--%: profile-do--net_2_0--%
+$(_boot_:%=profile-do--net_4_0--%):           profile-do--net_4_0--%:           profile-do--basic--%
 $(_boot_:%=profile-do--net_3_5--%):           profile-do--net_3_5--%:           profile-do--net_2_0--%
-$(_boot_:%=profile-do--moonlight--%):           profile-do--moonlight--%:           profile-do--moonlight_raw--%
-$(_boot_:%=profile-do--monodroid--%):         profile-do--monodroid--%:         profile-do--monodroid_bootstrap--%
-$(_boot_:%=profile-do--monodroid_bootstrap--%): profile-do--monodroid_bootstrap--%: profile-do--net_2_0--%
-$(_boot_:%=profile-do--monotouch--%):         profile-do--monotouch--%:         profile-do--monotouch_bootstrap--%
-$(_boot_:%=profile-do--monotouch_bootstrap--%): profile-do--monotouch_bootstrap--%: profile-do--net_2_0--%
-$(_boot_:%=profile-do--moonlight_raw--%):       profile-do--moonlight_raw--%:       profile-do--moonlight_bootstrap--%
-$(_boot_:%=profile-do--moonlight_bootstrap--%): profile-do--moonlight_bootstrap--%: profile-do--basic--%
-$(_boot_:%=profile-do--net_2_0--%):           profile-do--net_2_0--%:           profile-do--net_2_0_bootstrap--%
-$(_boot_:%=profile-do--net_2_0_bootstrap--%): profile-do--net_2_0_bootstrap--%: profile-do--basic--%
+$(_boot_:%=profile-do--moonlight--%):         profile-do--moonlight--%:         profile-do--moonlight_raw--%
+$(_boot_:%=profile-do--monodroid--%):         profile-do--monodroid--%:         profile-do--basic--%
+$(_boot_:%=profile-do--monotouch--%):         profile-do--monotouch--%:         profile-do--basic--%
+$(_boot_:%=profile-do--moonlight_raw--%):     profile-do--moonlight_raw--%:     profile-do--basic--%
+$(_boot_:%=profile-do--net_2_0--%):           profile-do--net_2_0--%:           profile-do--basic--%
 
 testcorlib:
 	@cd class/corlib && $(MAKE) test run-test

+ 5 - 7
mcs/build/profiles/monodroid.make

@@ -1,17 +1,15 @@
 #! -*- makefile -*-
 
-my_runtime = $(RUNTIME) $(RUNTIME_FLAGS) --security=temporary-smcs-hack
-INTERNAL_SMCS = $(my_runtime) $(topdir)/class/lib/$(PROFILE)/smcs.exe
+BOOTSTRAP_PROFILE = basic
 
-BOOTSTRAP_PROFILE = monodroid_bootstrap
-
-BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(my_runtime) $(topdir)/class/lib/$(BOOTSTRAP_PROFILE)/smcs.exe
-MCS = MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_SMCS)
+BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
+MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
 
 profile-check:
 	@:
 
-PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:MOBILE -d:MONODROID
+DEFAULT_REFERENCES = -r:mscorlib.dll
+PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:MOBILE -d:MONODROID -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES)
 FRAMEWORK_VERSION = 2.1
 NO_TEST = yes
 

+ 5 - 7
mcs/build/profiles/monotouch.make

@@ -1,17 +1,15 @@
 #! -*- makefile -*-
 
-my_runtime = $(RUNTIME) $(RUNTIME_FLAGS) --security=temporary-smcs-hack
-INTERNAL_SMCS = $(my_runtime) $(topdir)/class/lib/$(PROFILE)/smcs.exe
+BOOTSTRAP_PROFILE = basic
 
-BOOTSTRAP_PROFILE = monotouch_bootstrap
-
-BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(my_runtime) $(topdir)/class/lib/$(BOOTSTRAP_PROFILE)/smcs.exe
-MCS = MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_SMCS)
+BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
+MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
 
 profile-check:
 	@:
 
-PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:MOBILE -d:MONOTOUCH
+DEFAULT_REFERENCES = -r:mscorlib.dll
+PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:MOBILE -d:MONOTOUCH -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES)
 FRAMEWORK_VERSION = 2.1
 NO_TEST = yes
 

+ 5 - 7
mcs/build/profiles/moonlight_raw.make

@@ -1,17 +1,15 @@
 #! -*- makefile -*-
 
-my_runtime = $(RUNTIME) $(RUNTIME_FLAGS) --security=temporary-smcs-hack
-INTERNAL_SMCS = $(my_runtime) $(topdir)/class/lib/$(PROFILE)/smcs.exe
+BOOTSTRAP_PROFILE = basic
 
-BOOTSTRAP_PROFILE = moonlight_bootstrap
-
-BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(my_runtime) $(topdir)/class/lib/$(BOOTSTRAP_PROFILE)/smcs.exe
-MCS = MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_SMCS)
+BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
+MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
 
 profile-check:
 	@:
 
-PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:MOONLIGHT
+DEFAULT_REFERENCES = -r:mscorlib.dll
+PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_2_1 -d:MOONLIGHT -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES)
 FRAMEWORK_VERSION = 2.1
 NO_TEST = yes
 

+ 5 - 3
mcs/build/profiles/net_2_0.make

@@ -1,14 +1,16 @@
 # -*- makefile -*-
 
 BOOTSTRAP_PROFILE = basic
-BUILD_TOOLS_PROFILE = net_2_0_bootstrap
+BUILD_TOOLS_PROFILE = net_2_0
 BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
-MCS = MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
+MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
 
 # nuttzing!
 
 profile-check:
 	@:
 
-PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -nowarn:1699
+DEFAULT_REFERENCES = -r:mscorlib.dll
+PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES)
+
 FRAMEWORK_VERSION = 2.0

+ 4 - 3
mcs/build/profiles/net_3_5.make

@@ -1,14 +1,15 @@
 # -*- makefile -*-
 
-INTERNAL_GMCS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/net_2_0/gmcs.exe
+MCS = MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
 
-MCS = MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$(topdir)/class/lib/net_2_0$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
 # nuttzing!
 
 profile-check:
 	@:
 
-PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_3_5
+DEFAULT_REFERENCES = -r:mscorlib.dll
+PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_3_5 -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) -lib:$(topdir)/class/lib/net_2_0 $(DEFAULT_REFERENCES)
+
 FRAMEWORK_VERSION = 3.5
 
 TEST_HARNESS = $(topdir)/class/lib/net_2_0/nunit-console.exe

+ 6 - 7
mcs/build/profiles/net_4_0.make

@@ -1,17 +1,16 @@
 # -*- makefile -*-
 
-INTERNAL_DMCS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/dmcs.exe
+BOOTSTRAP_PROFILE = basic
 
-BOOTSTRAP_PROFILE = net_4_0_bootstrap
-
-BOOTSTAP_DMCS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BOOTSTRAP_PROFILE)/dmcs.exe
-BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(BOOTSTAP_DMCS)
-MCS = MONO_PATH="$(topdir)/class/lib/$(PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_DMCS)
+BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
+MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_GMCS)
 
 # nuttzing!
 
 profile-check:
 	@:
 
-PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_3_0 -d:NET_3_5 -d:NET_4_0 -nowarn:1699
+DEFAULT_REFERENCES = -r:mscorlib.dll
+PROFILE_MCS_FLAGS = -d:NET_1_1 -d:NET_2_0 -d:NET_3_0 -d:NET_3_5 -d:NET_4_0 -nowarn:1699 -nostdlib -lib:$(topdir)/class/lib/$(PROFILE) $(DEFAULT_REFERENCES)
+
 FRAMEWORK_VERSION = 4.0

+ 1 - 7
mcs/build/rules.make

@@ -36,9 +36,8 @@ INSTALL_DATA = $(INSTALL) -c -m 644
 INSTALL_BIN = $(INSTALL) -c -m 755
 INSTALL_LIB = $(INSTALL_BIN)
 MKINSTALLDIRS = $(SHELL) $(topdir)/mkinstalldirs
-INTERNAL_MCS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/mcs.exe
 INTERNAL_MBAS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/mbas/mbas.exe
-INTERNAL_GMCS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/gmcs.exe
+INTERNAL_GMCS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/basic/mcs.exe
 INTERNAL_ILASM = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(PROFILE)/ilasm.exe
 corlib = mscorlib.dll
 
@@ -197,11 +196,6 @@ dist-default:
 	$(MKINSTALLDIRS) $(@D)
 	touch $@
 
-# Useful
-
-withmcs:
-	$(MAKE) MCS='$(INTERNAL_MCS)' BOOTSTRAP_MCS='$(INTERNAL_MCS)' all
-
 ## Documentation stuff
 
 Q_MDOC =$(if $(V),,@echo "MDOC    [$(PROFILE)] $(notdir $(@))";)

+ 3 - 26
mcs/class/Makefile

@@ -1,19 +1,8 @@
 thisdir = class
 
-bootstrap_dirs := \
-	corlib					\
-	Mono.CompilerServices.SymbolWriter	\
-	System					\
-	System.XML				\
-	Mono.Security				\
-	System.Security				\
-	System.Configuration			\
-	System
-
-
 # Note that Mono.Security and System.Security aren't listed.
 # We may have to add those if 'mcs' starts using them.
-basic_SUBDIRS := corlib System System.XML System Mono.Security Mono.CompilerServices.SymbolWriter System.Core
+basic_SUBDIRS := corlib System System.XML System Mono.Security Mono.CompilerServices.SymbolWriter System.Core aot-compiler
 
 net_1_1_java_SUBDIRS = \
 	System.Xml					\
@@ -37,7 +26,6 @@ common_dirs := \
 	System.Configuration		\
 	System				\
 	System.XML			\
-	aot-compiler		\
 	I18N				\
 	System.Drawing			\
 	System.Transactions		\
@@ -124,17 +112,11 @@ net_2_0_only_dirs := \
 	System.Web.Extensions.Design_1.0	\
 	Compat.ICSharpCode.SharpZipLib
 
-net_2_1_bootstrap_dirs := \
-	corlib		\
-	System		\
-	Mono.CompilerServices.SymbolWriter	\
-	System.Core
-
 moonlight_dirs := \
 	corlib			\
+	System			\
 	Mono.CompilerServices.SymbolWriter \
 	System.Core		\
-	System			\
 	System.XML		\
 	System.Net		\
 	System.Xml.Linq	\
@@ -145,9 +127,9 @@ moonlight_dirs := \
 
 mobile_dirs := \
 	corlib	\
+	System	\
 	Mono.CompilerServices.SymbolWriter	\
 	System.Core	\
-	System	\
 	System.XML	\
 	Mono.Security	\
 	System	\
@@ -183,16 +165,11 @@ net_4_0_dirs := \
 	System.Runtime.DurableInstancing \
 	Mono.CodeContracts
 
-net_2_0_bootstrap_SUBDIRS := $(bootstrap_dirs)
 net_2_0_SUBDIRS := $(common_dirs) $(net_2_0_dirs) $(net_2_0_only_dirs)
-moonlight_bootstrap_SUBDIRS := $(net_2_1_bootstrap_dirs)
 moonlight_raw_SUBDIRS := $(moonlight_dirs)
-monodroid_bootstrap_SUBDIRS := $(net_2_1_bootstrap_dirs)
 monodroid_SUBDIRS := $(mobile_dirs)
-monotouch_bootstrap_SUBDIRS := $(net_2_1_bootstrap_dirs)
 monotouch_SUBDIRS := $(mobile_dirs)
 net_3_5_SUBDIRS := $(net_3_5_only_dirs)
-net_4_0_bootstrap_SUBDIRS := $(bootstrap_dirs) Mono.Posix System.Core
 net_4_0_SUBDIRS := $(common_dirs) $(net_2_0_dirs) $(net_4_0_dirs)
 
 include ../build/rules.make

+ 1 - 1
mcs/class/Mono.CompilerServices.SymbolWriter/Makefile

@@ -5,7 +5,7 @@ include ../../build/rules.make
 LIBRARY = Mono.CompilerServices.SymbolWriter.dll
 LIBRARY_USE_INTERMEDIATE_FILE = yes
 
-LIB_MCS_FLAGS = /r:$(corlib) /r:System.dll
+LIB_MCS_FLAGS = /r:System.dll
 NO_TEST = yes
 
 ifneq (basic, $(PROFILE))

+ 2 - 7
mcs/class/System.Core/Makefile

@@ -4,7 +4,7 @@ include ../../build/rules.make
 
 LIBRARY = System.Core.dll
 
-LIB_MCS_FLAGS = -d:INSIDE_SYSCORE -d:LIBC /r:$(corlib) /r:System
+LIB_MCS_FLAGS = -d:INSIDE_SYSCORE -d:LIBC /r:$(corlib) /r:System.dll
 
 ifneq (2.1, $(FRAMEWORK_VERSION))
 LIB_MCS_FLAGS += -d:NET_3_5 -nowarn:1720
@@ -18,17 +18,12 @@ ifeq (4.0, $(FRAMEWORK_VERSION))
 LIB_MCS_FLAGS += -d:CODEPLEX_40
 endif
 
-FULL_PROFILE := $(filter net_2_0 net_4_0 moonlight_raw monotouch monodroid, $(PROFILE))
-ifdef FULL_PROFILE
-LIBRARY_COMPILE = $(BOOT_COMPILE)
-endif
-
 ifneq (basic, $(PROFILE))
 CLR_PROFILE := $(filter 2.0 4.0, $(FRAMEWORK_VERSION))
 endif
 
 ifdef CLR_PROFILE
-LIB_MCS_FLAGS += -r:../lib/$(PROFILE)/Mono.Posix -unsafe
+LIB_MCS_FLAGS += -r:Mono.Posix.dll -unsafe
 endif
 
 TEST_MCS_FLAGS = $(LIB_MCS_FLAGS)

+ 1 - 2
mcs/class/System.Web.Extensions.Design_1.0/Makefile

@@ -8,8 +8,7 @@ LIBRARY_COMPAT = yes
 NO_TEST = yes
 
 LIB_MCS_FLAGS = \
-	-r:System.dll			\
-	-r:System.Design.dll		\
+	-r:System.dll -r:System.Design.dll -r:System.Drawing.dll \
 	$(OTHER_LIB_MCS_FLAGS)
 
 include ../../build/library.make

+ 0 - 4
mcs/class/System.XML/Makefile

@@ -10,10 +10,6 @@ ifndef lib_file
 USE_BOOT_COMPILE = yes
 endif
 
-ifeq (monotouch, $(PROFILE))
-BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/monotouch$(PLATFORM_PATH_SEPARATOR)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_SMCS)
-endif
-
 ifdef USE_BOOT_COMPILE
 LIBRARY_COMPILE = $(BOOT_COMPILE)
 endif

+ 1 - 12
mcs/class/aot-compiler/Makefile

@@ -10,12 +10,7 @@ include ../../build/rules.make
 
 the_libdir = $(topdir)/class/lib/$(PROFILE)/
 
-ifeq (net_2_0, $(PROFILE))
-mcs_exe = $(the_libdir)/gmcs.exe
-else ifeq (net_4_0, $(PROFILE))
-mcs_exe = $(the_libdir)/dmcs.exe
-endif
-
+mcs_exe = $(the_libdir)/mcs.exe
 mcs_aot_image = $(mcs_exe)$(PLATFORM_AOT_SUFFIX)
 
 mscorlib_dll = $(the_libdir)/mscorlib.dll
@@ -34,13 +29,7 @@ $(mscorlib_aot_image): $(mscorlib_dll)
 
 ifdef ENABLE_AOT
 
-ifeq (net_2_0, $(PROFILE))
-all-local: $(mscorlib_aot_image) $(mcs_aot_image)
-endif
-
-ifeq (net_4_0, $(PROFILE))
 all-local: $(mscorlib_aot_image) $(mcs_aot_image)
-endif
 
 clean-local:
 	-rm -f $(mscorlib_aot_image) $(mcs_aot_image) $(PROFILE)_aot.log

+ 8 - 3
mcs/class/corlib/Makefile

@@ -5,9 +5,13 @@ export __SECURITY_BOOTSTRAP_DB=$(topdir)/class/corlib
 
 LIBRARY = corlib.dll
 LIBRARY_NAME = mscorlib.dll
-LIB_MCS_FLAGS = $(corlib_flags) $(RESOURCE_FILES:%=-resource:%)
+LIB_MCS_FLAGS = $(RESOURCE_FILES:%=-resource:%)
 LIBRARY_USE_INTERMEDIATE_FILE = yes
 
+ifeq (4.0, $(FRAMEWORK_VERSION))
+LIB_MCS_FLAGS += --runtime:v4
+endif
+
 LIBRARY_COMPILE = $(BOOT_COMPILE)
 LIBRARY_INSTALL_DIR = $(mono_libdir)/mono/$(FRAMEWORK_VERSION)
 
@@ -20,8 +24,8 @@ RESOURCE_FILES = \
 	resources/collation.cjkKO.bin \
 	resources/collation.cjkKOlv2.bin
 
-corlib_flags = -unsafe -nostdlib
-LOCAL_MCS_FLAGS = -nowarn:612,618 -d:INSIDE_CORLIB -d:LIBC
+LOCAL_MCS_FLAGS = -unsafe -nostdlib -nowarn:612,618 -d:INSIDE_CORLIB -d:LIBC
+DEFAULT_REFERENCES =
 
 # System.IO/DirectoryInfoTest.cs needs Mono.Posix
 TEST_MCS_FLAGS = -debug+ -debug:full -nowarn:168,219,618,672 -unsafe -r:$(topdir)/class/lib/$(PROFILE)/Mono.Posix.dll -define:MONO_DATACONVERTER_STATIC_METHODS
@@ -43,6 +47,7 @@ include $(topdir)/build/library.make
 
 ifdef FIXME_CORLIB_CMP
 # corlib_cmp
+corlib_flags = -unsafe -nostdlib
 cmplib = $(topdir)/class/lib/$(PROFILE)/corlib_cmp.dll
 cmppdb = $(cmplib:.dll=.pdb)
 cmp_response = $(depsdir)/$(PROFILE)_corlib_cmp.dll.response

+ 5 - 6
mcs/mcs/Makefile

@@ -12,14 +12,13 @@ EXTRA_DISTFILES = \
 	TODO			\
 	*mcs.exe.config
 
-COMPILER_NAME = gmcs
-
-ifeq (net_2_0, $(PROFILE))
-INTERNAL_GMCS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BOOTSTRAP_PROFILE)/gmcs.exe
+ifeq (basic, $(PROFILE))
+LOCAL_MCS_FLAGS += -d:STATIC
+COMPILER_NAME = mcs
 endif
 
-ifeq (moonlight_bootstrap, $(PROFILE))
-INTERNAL_GMCS = $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BOOTSTRAP_PROFILE)/gmcs.exe
+ifeq (net_2_0, $(PROFILE))
+COMPILER_NAME = gmcs
 endif
 
 ifeq (2.1, $(FRAMEWORK_VERSION))

+ 176 - 0
mcs/mcs/mcs.csproj

@@ -0,0 +1,176 @@
+<?xml version="1.0" encoding="utf-8"?>
+<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
+  <PropertyGroup>
+    <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
+    <Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
+    <ProductVersion>10.0.20506</ProductVersion>
+    <SchemaVersion>2.0</SchemaVersion>
+    <ProjectGuid>{D4A01C5B-A1B5-48F5-BB5B-D2E1BD236E56}</ProjectGuid>
+    <OutputType>Exe</OutputType>
+    <AppDesignerFolder>Properties</AppDesignerFolder>
+    <RootNamespace>Mono.CSharp</RootNamespace>
+    <AssemblyName>mcs</AssemblyName>
+    <TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
+    <FileAlignment>512</FileAlignment>
+    <PlatformTarget>x86</PlatformTarget>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
+    <DebugSymbols>true</DebugSymbols>
+    <DebugType>full</DebugType>
+    <Optimize>false</Optimize>
+    <OutputPath>.\</OutputPath>
+    <DefineConstants>TRACE;DEBUG;NET_4_0;STATIC</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <UseVSHostingProcess>true</UseVSHostingProcess>
+  </PropertyGroup>
+  <PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
+    <DebugType>pdbonly</DebugType>
+    <Optimize>true</Optimize>
+    <DefineConstants>TRACE;NET_4_0;STATIC</DefineConstants>
+    <ErrorReport>prompt</ErrorReport>
+    <ErrorReport>prompt</ErrorReport>
+    <WarningLevel>4</WarningLevel>
+    <OutputPath>.\</OutputPath>
+  </PropertyGroup>
+  <ItemGroup>
+    <Reference Include="System" />
+    <Reference Include="System.Xml" />
+  </ItemGroup>
+  <ItemGroup>
+    <Compile Include="..\build\common\Consts.cs">
+    </Compile>
+    <Compile Include="..\class\corlib\Mono.Security.Cryptography\CryptoConvert.cs">
+      <Link>CryptoConvert.cs</Link>
+    </Compile>
+    <Compile Include="..\class\Mono.CompilerServices.SymbolWriter\MonoSymbolFile.cs">
+      <Link>MonoSymbolFile.cs</Link>
+    </Compile>
+    <Compile Include="..\class\Mono.CompilerServices.SymbolWriter\MonoSymbolTable.cs">
+      <Link>MonoSymbolTable.cs</Link>
+    </Compile>
+    <Compile Include="..\class\Mono.CompilerServices.SymbolWriter\MonoSymbolWriter.cs">
+      <Link>MonoSymbolWriter.cs</Link>
+    </Compile>
+    <Compile Include="argument.cs" />
+    <Compile Include="assembly.cs" />
+    <Compile Include="AssemblyInfo.cs">
+    </Compile>
+    <Compile Include="anonymous.cs">
+    </Compile>
+    <Compile Include="assign.cs">
+    </Compile>
+    <Compile Include="attribute.cs">
+    </Compile>
+    <Compile Include="cfold.cs">
+    </Compile>
+    <Compile Include="class.cs">
+    </Compile>
+    <Compile Include="codegen.cs">
+    </Compile>
+    <Compile Include="complete.cs" />
+    <Compile Include="const.cs">
+    </Compile>
+    <Compile Include="constant.cs">
+    </Compile>
+    <Compile Include="convert.cs">
+    </Compile>
+    <Compile Include="context.cs" />
+    <Compile Include="dynamic.cs" />
+    <Compile Include="eval.cs" />
+    <Compile Include="ikvm.cs" />
+    <Compile Include="import.cs" />
+    <Compile Include="lambda.cs">
+    </Compile>
+    <Compile Include="cs-parser.cs" />
+    <Compile Include="cs-tokenizer.cs">
+    </Compile>
+    <Compile Include="decl.cs">
+    </Compile>
+    <Compile Include="delegate.cs">
+    </Compile>
+    <Compile Include="doc.cs">
+    </Compile>
+    <Compile Include="driver.cs">
+    </Compile>
+    <Compile Include="ecore.cs">
+    </Compile>
+    <Compile Include="enum.cs">
+    </Compile>
+    <Compile Include="expression.cs">
+    </Compile>
+    <Compile Include="flowanalysis.cs">
+    </Compile>
+    <Compile Include="generic.cs" />
+    <Compile Include="iterators.cs">
+    </Compile>
+    <Compile Include="literal.cs">
+    </Compile>
+    <Compile Include="location.cs">
+    </Compile>
+    <Compile Include="membercache.cs" />
+    <Compile Include="method.cs" />
+    <Compile Include="modifiers.cs">
+    </Compile>
+    <Compile Include="namespace.cs">
+    </Compile>
+    <Compile Include="nullable.cs" />
+    <Compile Include="..\tools\monop\outline.cs">
+      <Link>outline.cs</Link>
+    </Compile>
+    <Compile Include="parameter.cs" />
+    <Compile Include="pending.cs" />
+    <Compile Include="property.cs" />
+    <Compile Include="reflection.cs" />
+    <Compile Include="report.cs" />
+    <Compile Include="rootcontext.cs">
+    </Compile>
+    <Compile Include="roottypes.cs">
+    </Compile>
+    <Compile Include="statement.cs">
+    </Compile>
+    <Compile Include="support.cs">
+    </Compile>
+    <Compile Include="symbolwriter.cs">
+    </Compile>
+    <Compile Include="typemanager.cs">
+    </Compile>
+    <Compile Include="linq.cs" />
+    <Compile Include="field.cs" />
+    <Compile Include="typespec.cs" />
+  </ItemGroup>
+  <ItemGroup Label="IKVM.Reflection">
+    <Compile Include="..\class\IKVM.Reflection\*.cs">
+      <Visible>false</Visible>
+    </Compile>
+    <Compile Include="..\class\IKVM.Reflection\Emit\*.cs">
+      <Visible>false</Visible>
+    </Compile>
+    <Compile Include="..\class\IKVM.Reflection\Metadata\*.cs">
+      <Visible>false</Visible>
+    </Compile>
+    <Compile Include="..\class\IKVM.Reflection\Reader\*.cs">
+      <Visible>false</Visible>
+    </Compile>
+    <Compile Include="..\class\IKVM.Reflection\Writer\*.cs">
+      <Visible>false</Visible>
+    </Compile>
+    <Compile Include="..\class\IKVM.Reflection\Impl\CryptoHack.cs">
+      <Visible>false</Visible>
+    </Compile>
+    <Compile Include="..\class\IKVM.Reflection\Impl\ITypeOwner.cs">
+      <Visible>false</Visible>
+    </Compile>
+    <Compile Include="..\class\IKVM.Reflection\Impl\SymbolSupport.cs">
+      <Visible>false</Visible>
+    </Compile>
+  </ItemGroup>
+  <Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
+  <!-- To modify your build process, add your task inside one of the targets below and uncomment it. 
+       Other similar extension points exist, see Microsoft.Common.targets.
+  <Target Name="BeforeBuild">
+  </Target>
+  <Target Name="AfterBuild">
+  </Target>
+  -->
+</Project>

+ 67 - 0
mcs/mcs/mcs.exe.sources

@@ -0,0 +1,67 @@
+AssemblyInfo.cs
+anonymous.cs
+argument.cs
+assign.cs
+assembly.cs
+attribute.cs
+cs-tokenizer.cs
+cfold.cs
+class.cs
+codegen.cs
+complete.cs
+const.cs
+constant.cs
+convert.cs
+context.cs
+decl.cs
+delegate.cs
+doc.cs
+driver.cs
+dynamic.cs
+ecore.cs
+enum.cs
+eval.cs
+expression.cs
+field.cs
+flowanalysis.cs
+generic.cs
+import.cs
+iterators.cs
+ikvm.cs
+lambda.cs
+linq.cs
+literal.cs
+location.cs
+membercache.cs
+method.cs
+modifiers.cs
+namespace.cs
+nullable.cs
+parameter.cs
+pending.cs
+property.cs
+reflection.cs
+report.cs
+rootcontext.cs
+roottypes.cs
+statement.cs
+support.cs
+typemanager.cs
+typespec.cs
+visit.cs
+symbolwriter.cs
+../class/Mono.CompilerServices.SymbolWriter/MonoSymbolFile.cs
+../class/Mono.CompilerServices.SymbolWriter/MonoSymbolTable.cs
+../class/Mono.CompilerServices.SymbolWriter/MonoSymbolWriter.cs
+../class/corlib/Mono.Security.Cryptography/CryptoConvert.cs
+../build/common/Consts.cs
+../tools/monop/outline.cs
+
+../class/IKVM.Reflection/*.cs
+../class/IKVM.Reflection/Emit/*.cs
+../class/IKVM.Reflection/Metadata/*.cs
+../class/IKVM.Reflection/Reader/*.cs
+../class/IKVM.Reflection/Writer/*.cs
+../class/IKVM.Reflection/Impl/CryptoHack.cs
+../class/IKVM.Reflection/Impl/ITypeOwner.cs
+../class/IKVM.Reflection/Impl/SymbolSupport.cs