Browse Source

[build] Add wasm profile

Marek Safar 8 years ago
parent
commit
f2e658cdca

+ 25 - 1
configure.ac

@@ -922,6 +922,7 @@ AC_ARG_WITH(testing_aot_full,    [  --with-testing_aot_full=yes,no      If you w
 AC_ARG_WITH(winaot,              [  --with-winaot=yes,no                If you want to build the Windows friendly AOT assemblies (defaults to no)], [], [with_winaot=default])
 AC_ARG_WITH(orbis,               [  --with-orbis=yes,no                 If you want to build the Orbis assemblies (defaults to no)], [], [with_orbis=default])
 AC_ARG_WITH(unreal,              [  --with-unreal=yes,no                If you want to build the Unreal assemblies (defaults to no)], [], [with_unreal=default])
+AC_ARG_WITH(wasm,                [  --with-wasm=yes,no                  If you want to build the WebAssembly (defaults to no)], [], [with_wasm=default])
 
 
 AC_ARG_WITH(runtime_preset, [  --with-runtime_preset=net_4_x,all,aot,hybridaot,fullaot,bitcode,unreal   Which default profile to build (defaults to net_4_x)],  [], [with_runtime_preset=net_4_x])
@@ -943,6 +944,7 @@ with_testing_aot_full_default=no
 with_winaot_default=no
 with_orbis_default=no
 with_unreal_default=no
+with_wasm_default=no
 
 with_bitcode_default=no
 with_cooperative_gc_default=no
@@ -963,6 +965,7 @@ elif test x$with_runtime_preset = xall; then
    with_winaot_default=yes
    with_orbis_default=yes
    with_unreal_default=yes
+   with_wasm_default=yes
 elif test x$with_runtime_preset = xfullaot; then
    DISABLE_MCS_DOCS_default=yes
    with_testing_aot_full_default=yes
@@ -1044,6 +1047,19 @@ elif test x$with_runtime_preset = xunreal; then
 
    AOT_BUILD_FLAGS="--runtime=mobile --aot=hybrid,$INVARIANT_AOT_OPTIONS"
    AOT_RUN_FLAGS="--runtime=mobile --hybrid-aot"
+elif test x$with_runtime_preset = xwasm; then
+   DISABLE_MCS_DOCS_default=yes
+   with_wasm_default=yes
+   TEST_PROFILE=wasm
+
+   mono_feature_disable_com='yes'
+   mono_feature_disable_remoting='yes'
+   mono_feature_disable_reflection_emit_save='yes'
+   mono_feature_disable_reflection_emit='yes'
+   mono_feature_disable_appdomains='yes'
+
+   AOT_BUILD_FLAGS="--runtime=mobile --aot=full,$INVARIANT_AOT_OPTIONS"
+   AOT_RUN_FLAGS="--runtime=mobile --full-aot"
 else
    with_profile4_x_default=yes
 fi
@@ -1093,6 +1109,9 @@ fi
 if test "x$with_unreal" = "xdefault"; then
    with_unreal=$with_unreal_default
 fi
+if test "x$with_wasm" = "xdefault"; then
+   with_wasm=$with_wasm_default
+fi
 
 
 AM_CONDITIONAL(INSTALL_4_x, [test "x$with_profile4_x" = "xyes"])
@@ -1107,7 +1126,8 @@ AM_CONDITIONAL(INSTALL_TESTING_AOT_FULL, [test "x$with_testing_aot_full" != "xno
 AM_CONDITIONAL(INSTALL_WINAOT, [test "x$with_winaot" != "xno"])
 AM_CONDITIONAL(INSTALL_ORBIS, [test "x$with_orbis" != "xno"])
 AM_CONDITIONAL(INSTALL_UNREAL, [test "x$with_unreal" != "xno"])
-AM_CONDITIONAL(FULL_AOT_TESTS, [test "x$TEST_PROFILE" = "xtesting_aot_full"] || [test "x$TEST_PROFILE" = "xwinaot"] || [test "x$TEST_PROFILE" = "xorbis"])
+AM_CONDITIONAL(INSTALL_WASM, [test "x$with_wasm" != "xno"])
+AM_CONDITIONAL(FULL_AOT_TESTS, [test "x$TEST_PROFILE" = "xtesting_aot_full"] || [test "x$TEST_PROFILE" = "xwinaot"] || [test "x$TEST_PROFILE" = "xorbis"] || [test "x$TEST_PROFILE" = "xwasm"])
 AM_CONDITIONAL(HYBRID_AOT_TESTS, [test "x$TEST_PROFILE" = "xtesting_aot_hybrid"] || [test "x$TEST_PROFILE" = "xunreal"])
 
 default_profile=net_4_x
@@ -1135,6 +1155,9 @@ fi
 if test -z "$INSTALL_UNREAL_TRUE"; then :
    default_profile=unreal
 fi
+if test -z "$INSTALL_WASM_TRUE"; then :
+   default_profile=wasm
+fi
 if test -z "$INSTALL_4_x_TRUE"; then :
    default_profile=net_4_x
 fi
@@ -4883,6 +4906,7 @@ echo "
 	Windows AOT:     $with_winaot
 	Orbis:           $with_orbis
 	Unreal:          $with_unreal
+	WebAssembly:     $with_wasm
 	Test profiles:   AOT Full ($with_testing_aot_full), AOT Hybrid ($with_testing_aot_hybrid)
 	JNI support:     $jdk_headers_found
 	libgdiplus:      $libgdiplus_msg

+ 2 - 0
mcs/Makefile

@@ -25,6 +25,7 @@ xbuild_14_SUBDIRS := build class tools/xbuild
 winaot_SUBDIRS := build class
 orbis_SUBDIRS := build class
 unreal_SUBDIRS := build class
+wasm_SUBDIRS := build class
 
 include build/rules.make
 
@@ -81,6 +82,7 @@ $(_boot_:%=profile-do--testing_aot_full--%):          profile-do--testing_aot_fu
 $(_boot_:%=profile-do--winaot--%):              profile-do--winaot--%:              profile-do--build--%
 $(_boot_:%=profile-do--orbis--%):              profile-do--orbis--%:              profile-do--build--%
 $(_boot_:%=profile-do--unreal--%):              profile-do--unreal--%:              profile-do--build--%
+$(_boot_:%=profile-do--wasm--%):              profile-do--wasm--%:              profile-do--build--%
 $(_boot_:%=profile-do--build--%):             profile-do--build--%:             profile-do--basic--%
 
 testcorlib:

+ 40 - 0
mcs/build/profiles/wasm.make

@@ -0,0 +1,40 @@
+#! -*- makefile -*-
+
+BOOTSTRAP_PROFILE = build
+
+BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_CSC)
+MCS = $(BOOTSTRAP_MCS)
+
+profile-check:
+	@:
+
+DEFAULT_REFERENCES = -r:$(topdir)/class/lib/$(PROFILE)/mscorlib.dll
+
+PROFILE_MCS_FLAGS = \
+	-d:NET_1_1 \
+	-d:NET_2_0 \
+	-d:NET_2_1 \
+	-d:NET_3_5 \
+	-d:NET_4_0 \
+	-d:NET_4_5 \
+	-d:MONO \
+	-d:MOBILE,MOBILE_LEGACY \
+	-d:FULL_AOT_DESKTOP	\
+	-d:FULL_AOT_RUNTIME \
+	-d:WASM \
+	-d:DISABLE_REMOTING \
+	-d:DISABLE_COM \
+	-nowarn:1699 \
+	-nostdlib \
+	$(DEFAULT_REFERENCES) \
+	$(PLATFORM_DEBUG_FLAGS)
+
+FRAMEWORK_VERSION = 2.1
+
+# the tuner takes care of the install
+NO_INSTALL = yes
+AOT_FRIENDLY_PROFILE = yes
+ALWAYS_AOT = yes
+MOBILE_PROFILE = yes
+NO_VTS_TEST = yes
+NO_CONSOLE = yes

+ 1 - 1
mcs/class/Facades/System.Drawing.Primitives/Makefile

@@ -23,7 +23,7 @@ EMBEDDED_DRAWING_DEP := $(filter xammac_net_4_5 testing_aot_full testing_aot_hyb
 ifndef EMBEDDED_DRAWING_DEP
 
 # profiles which build a System.Drawing.dll in the repo
-REPO_DRAWING_DEP := $(filter net_4_x orbis winaot unreal, $(PROFILE))
+REPO_DRAWING_DEP := $(filter net_4_x orbis winaot unreal wasm, $(PROFILE))
 
 ifdef REPO_DRAWING_DEP
 LIB_REFS += System.Drawing

+ 1 - 1
mcs/class/Facades/netstandard/Makefile

@@ -29,7 +29,7 @@ LIB_REFS += System.Web
 endif
 
 # profiles which build a System.Drawing.dll in the repo
-REPO_DRAWING_DEP := $(filter net_4_x orbis winaot unreal, $(PROFILE))
+REPO_DRAWING_DEP := $(filter net_4_x orbis winaot unreal wasm, $(PROFILE))
 
 ifdef REPO_DRAWING_DEP
 LIB_REFS += System.Drawing

+ 3 - 0
mcs/class/Facades/subdirs.make

@@ -86,6 +86,9 @@ orbis_PARALLEL_SUBDIRS = $(common_SUBDIRS) $(mobile_only_SUBDIRS)
 unreal_SUBDIRS = $(common_DEPS_SUBDIRS) $(netstandard_drawing_SUBDIRS) $(mobile_only_DEPS_SUBDIRS)
 unreal_PARALLEL_SUBDIRS = $(common_SUBDIRS) $(mobile_only_SUBDIRS)
 
+wasm_SUBDIRS = $(common_DEPS_SUBDIRS) $(netstandard_drawing_SUBDIRS) $(mobile_only_DEPS_SUBDIRS)
+wasm_PARALLEL_SUBDIRS = $(common_SUBDIRS) $(mobile_only_SUBDIRS)
+
 mobile_only_SUBDIRS = System.Net.Ping System.Runtime.Serialization.Formatters System.Security.Cryptography.Csp System.Security.Cryptography.Pkcs \
 System.Security.Cryptography.Cng System.Runtime.Loader System.Xml.XPath.XmlDocument System.Reflection.DispatchProxy
 

+ 6 - 0
mcs/class/Makefile

@@ -144,6 +144,11 @@ unreal_dirs := \
 	System.Drawing			\
 	$(pcl_facade_dirs)
 
+wasm_dirs := \
+	$(mobile_common_dirs)	\
+	System.Drawing			\
+	$(pcl_facade_dirs)
+
 xammac_4_5_dirs := \
 	corlib	\
 	Mono.Security \
@@ -369,6 +374,7 @@ xbuild_14_SUBDIRS := $(xbuild_4_0_dirs) Microsoft.NuGet.Build.Tasks
 winaot_SUBDIRS := $(winaot_dirs)
 orbis_SUBDIRS := $(orbis_dirs)
 unreal_SUBDIRS := $(unreal_dirs)
+wasm_SUBDIRS := $(wasm_dirs)
 
 include ../build/rules.make
 

+ 1 - 0
mcs/class/System.Core/wasm_System.Core.dll.sources

@@ -0,0 +1 @@
+#include testing_aot_full_System.Core.dll.sources

+ 1 - 0
mcs/class/System.IdentityModel/wasm_System.IdentityModel.dll.sources

@@ -0,0 +1 @@
+#include mobile_System.IdentityModel.dll.sources

+ 1 - 0
mcs/class/System.Runtime.Serialization/wasm_System.Runtime.Serialization.dll.sources

@@ -0,0 +1 @@
+#include mobile_System.Runtime.Serialization.dll.sources

+ 1 - 0
mcs/class/System.Security/wasm_System.Security.dll.sources

@@ -0,0 +1 @@
+#include common_System.Security.dll.sources

+ 1 - 0
mcs/class/System.ServiceModel.Internals/wasm_System.ServiceModel.Internals.dll.sources

@@ -0,0 +1 @@
+#include mobile_System.ServiceModel.Internals.dll.sources

+ 1 - 0
mcs/class/System.ServiceModel.Web/wasm_System.ServiceModel.Web.dll.sources

@@ -0,0 +1 @@
+#include mobile_System.ServiceModel.Web.dll.sources

+ 1 - 0
mcs/class/System.ServiceModel/wasm_System.ServiceModel.dll.sources

@@ -0,0 +1 @@
+#include mobile_System.ServiceModel.dll.sources

+ 1 - 0
mcs/class/System.Web.Services/wasm_System.Web.Services.dll.sources

@@ -0,0 +1 @@
+#include mobile_System.Web.Services.dll.sources

+ 1 - 0
mcs/class/System.XML/wasm_System.Xml.dll.sources

@@ -0,0 +1 @@
+#include mobile_System.Xml.dll.sources

+ 1 - 0
mcs/class/System/wasm_System.dll.sources

@@ -0,0 +1 @@
+#include mobile_System.dll.sources