diff options
author | Marek Safar <marek.safar@gmail.com> | 2018-10-10 18:49:38 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-10-10 18:49:38 +0300 |
commit | 8d8fd97dbfc6f4213e0fe9fca7574808dd8496d3 (patch) | |
tree | 2de385dee698f56a5df6e47b220d7ccd340fbd7b | |
parent | 831e73abcd5b9e10b4aaff7872b8d68e8e0f60fd (diff) |
[build] Unify bootstrap profiles (#11024)
* [build] Unify bootstrap profiles
We can now rely on build only as we have reliable monolite and package
compilers
* Fixes genproj dependencies
* [csproj] Update project files
-rw-r--r-- | mcs/Makefile | 4 | ||||
-rw-r--r-- | mcs/build/library.make | 10 | ||||
-rw-r--r-- | mcs/build/profiles/basic.make | 129 | ||||
-rw-r--r-- | mcs/build/profiles/build.make | 122 | ||||
-rw-r--r-- | mcs/build/rules.make | 9 | ||||
-rw-r--r-- | mcs/build/tests.make | 18 | ||||
-rw-r--r-- | mcs/class/Makefile | 28 | ||||
-rw-r--r-- | mcs/class/Mono.Cecil.Mdb/Makefile | 9 | ||||
-rw-r--r-- | mcs/class/Mono.Cecil/Makefile | 9 | ||||
-rw-r--r-- | mcs/class/PEAPI/Makefile | 14 | ||||
-rw-r--r-- | mcs/class/PEAPI/PEAPI.csproj | 3 | ||||
-rw-r--r-- | mcs/class/System.ComponentModel.Composition.4.5/Makefile | 2 | ||||
-rw-r--r-- | mcs/class/System.Xml.Linq/Makefile | 2 | ||||
-rw-r--r-- | mcs/ilasm/Driver.cs | 12 | ||||
-rw-r--r-- | mcs/ilasm/Makefile | 12 | ||||
-rw-r--r-- | mcs/ilasm/ilasm.csproj | 9 | ||||
-rw-r--r-- | mcs/ilasm/ilasm.exe.sources | 6 | ||||
-rw-r--r-- | mcs/tools/Makefile | 2 | ||||
-rw-r--r-- | mcs/tools/cil-stringreplacer/Makefile | 8 | ||||
-rw-r--r-- | mcs/tools/gensources/Makefile | 12 | ||||
-rw-r--r-- | mcs/tools/gensources/gensources.cs (renamed from mcs/build/gensources.cs) | 11 | ||||
-rw-r--r-- | mcs/tools/gensources/gensources.exe.sources | 1 | ||||
-rw-r--r-- | msvc/scripts/Makefile | 4 |
23 files changed, 212 insertions, 224 deletions
diff --git a/mcs/Makefile b/mcs/Makefile index 555a85e826f..fc041e3a070 100644 --- a/mcs/Makefile +++ b/mcs/Makefile @@ -4,8 +4,7 @@ SUBDIRS := build jay mcs class nunit24 ilasm tools tests errors docs packages # Resgen is corlib specific tool -basic_SUBDIRS := build jay class -build_SUBDIRS := build class class/aot-compiler tools ilasm +build_SUBDIRS := build jay tools/gensources class class/aot-compiler tools monodroid_SUBDIRS := build class tools monodroid_tools_SUBDIRS := build class tools monotouch_SUBDIRS := build class tools @@ -83,7 +82,6 @@ $(_boot_:%=profile-do--winaot--%): profile-do--winaot--%: $(_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: @cd class/corlib && $(MAKE) test run-test diff --git a/mcs/build/library.make b/mcs/build/library.make index 56d3bd5199f..0ac5fc1bd92 100644 --- a/mcs/build/library.make +++ b/mcs/build/library.make @@ -289,15 +289,9 @@ endif # TODO: depend on all *.sources (except tests) for now and figure out how to list only needed files later PROFILE_sources = $(filter-out %test.dll.exclude.sources %test.dll.sources, $(wildcard *.sources)) -ifneq "x" "x$(PROFILE_RUNTIME)" -GENSOURCES_RUNTIME=$(PROFILE_RUNTIME) -else -GENSOURCES_RUNTIME=MONO_PATH="$(GENSOURCES_LIBDIR)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) -endif - sourcefile = $(depsdir)/$(PROFILE_PLATFORM)_$(PROFILE)_$(LIBRARY_SUBDIR)_$(LIBRARY).sources -$(sourcefile): $(PROFILE_sources) $(PROFILE_excludes) $(depsdir)/.stamp $(GENSOURCES_CS) - $(GENSOURCES_RUNTIME) --debug $(GENSOURCES_EXE) --strict "$@" "$(LIBRARY)" "$(PROFILE_PLATFORM)" "$(PROFILE)" +$(sourcefile): $(PROFILE_sources) $(PROFILE_excludes) $(depsdir)/.stamp + $(GENSOURCES) --strict --platformsdir:$(topdir)/build "$@" "$(LIBRARY)" "$(PROFILE_PLATFORM)" "$(PROFILE)" library_CLEAN_FILES += $(sourcefile) diff --git a/mcs/build/profiles/basic.make b/mcs/build/profiles/basic.make deleted file mode 100644 index 7dd7770fc51..00000000000 --- a/mcs/build/profiles/basic.make +++ /dev/null @@ -1,129 +0,0 @@ -# -*- makefile -*- - -monolite_path := $(topdir)/class/lib/monolite-$(BUILD_PLATFORM)/$(MONO_CORLIB_VERSION) - -with_mono_path_monolite = MONO_PATH="$(monolite_path)$(PLATFORM_PATH_SEPARATOR)$(monolite_path)/Facades$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" - -monolite_flag := $(depsdir)/use-monolite -use_monolite := $(wildcard $(monolite_flag)) - -MONOLITE_MSCORLIB = $(monolite_path)/mscorlib.dll - -ifdef use_monolite -ifdef MCS_MODE - CSC_LOCATION = $(monolite_path)/mcs.exe -endif - -PROFILE_RUNTIME = $(with_mono_path_monolite) $(RUNTIME) -BOOTSTRAP_MCS = $(PROFILE_RUNTIME) $(RUNTIME_FLAGS) $(CSC_LOCATION) - -else -PROFILE_RUNTIME = $(EXTERNAL_RUNTIME) -ifdef MCS_MODE - BOOTSTRAP_MCS = mcs -else - BOOTSTRAP_MCS = $(PROFILE_RUNTIME) $(RUNTIME_FLAGS) $(CSC_LOCATION) -endif -endif - -ILASM = $(PROFILE_RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/ilasm.exe -STRING_REPLACER = $(PROFILE_RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/tmp/cil-stringreplacer.exe -MCS = $(BOOTSTRAP_MCS) -GENSOURCES_CS = $(topdir)/build/gensources.cs -GENSOURCES_DIR = $(topdir)/build -GENSOURCES_EXE = $(GENSOURCES_DIR)/gensources.exe - -DEFAULT_REFERENCES = mscorlib - -PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:MONO -d:WIN_PLATFORM -d:BOOTSTRAP_BASIC -nowarn:1699 -nostdlib -API_BIN_PROFILE = v4.7.1 - -NO_SIGN_ASSEMBLY = yes -NO_TEST = yes -NO_INSTALL = yes -FRAMEWORK_VERSION = 4.5 - -# Compiler all using same bootstrap compiler -LIBRARY_COMPILE = $(BOOT_COMPILE) - -# Verbose basic only -# V = 1 - -# -# Copy from rules.make because I don't know how to unset MCS_FLAGS -# -USE_MCS_FLAGS = /codepage:$(CODEPAGE) /nologo /noconfig /deterministic $(LOCAL_MCS_FLAGS) $(PLATFORM_MCS_FLAGS) $(PROFILE_MCS_FLAGS) $(MCS_FLAGS) - -.PHONY: profile-check do-profile-check -profile-check: - @: - -ifeq (.,$(thisdir)) -all-recursive: do-profile-check -all-local: post-profile-cleanup -clean-local: clean-profile -endif - -clean-profile: - -rm -f $(PROFILE_EXE) $(PROFILE_OUT) $(monolite_flag) - -post-profile-cleanup: - @rm -f $(monolite_flag) - -PROFILE_EXE = $(depsdir)/basic-profile-check.exe -PROFILE_OUT = $(PROFILE_EXE:.exe=.out) - -MAKE_Q=$(if $(V),,-s) - -do-profile-check: $(depsdir)/.stamp - @ok=:; \ - rm -f $(PROFILE_EXE) $(PROFILE_OUT); \ - if [ -z '$(MAKE_Q)' ] && [ -n '$(PROFILE_RUNTIME)' ]; then $(PROFILE_RUNTIME) --version; fi; \ - $(MAKE) $(MAKE_Q) $(PROFILE_OUT) || ok=false; \ - if $$ok; then rm -f $(PROFILE_EXE) $(PROFILE_OUT); else \ - if test ! -s $(MONOLITE_MSCORLIB); then \ - $(MAKE) $(MAKE_Q) do-get-monolite ; \ - fi; \ - if test -f $(MONOLITE_MSCORLIB); then \ - $(MAKE) $(MAKE_Q) do-profile-check-monolite ; \ - else \ - echo "*** The runtime '$(PROFILE_RUNTIME)' doesn't appear to be usable." 1>&2; \ - echo "*** Check README for information on how to bootstrap a Mono installation." 1>&2 ; \ - exit 1; fi; fi - - -ifdef use_monolite - -do-get-monolite: - -do-profile-check-monolite: - @echo "*** The contents of your 'monolite-$(BUILD_PLATFORM)/$(MONO_CORLIB_VERSION)' directory may be out-of-date" 1>&2 - @echo "*** You may want to try 'make get-monolite-latest'" 1>&2 - rm -f $(monolite_flag) - exit 1 - -else - -do-get-monolite: - @echo "*** Downloading bootstrap required 'monolite-$(BUILD_PLATFORM)/$(MONO_CORLIB_VERSION)'" 1>&2 - $(MAKE) $(MAKE_Q) -C $(topdir)/class get-monolite-latest - -do-profile-check-monolite: $(depsdir)/.stamp - @echo "*** The runtime '$(PROFILE_RUNTIME)' doesn't appear to be usable." 1>&2 - @echo "*** Trying the 'monolite-$(BUILD_PLATFORM)/$(MONO_CORLIB_VERSION)' directory." 1>&2 - @echo dummy > $(monolite_flag) - $(MAKE) do-profile-check - -endif - -$(PROFILE_EXE): $(topdir)/build/common/basic-profile-check.cs $(GENSOURCES_CS) - $(MAKE) $(MAKE_Q) -C $(topdir)/packages - $(BOOTSTRAP_MCS) /warn:0 /noconfig /langversion:latest /r:System.dll /r:mscorlib.dll /out:$@.tmp $< - $(BOOTSTRAP_MCS) /noconfig /langversion:latest /r:mscorlib.dll /r:System.dll /r:System.Core.dll /out:$(GENSOURCES_EXE).tmp $(GENSOURCES_CS) - - rm $(GENSOURCES_EXE) - mv $(GENSOURCES_EXE).tmp $(GENSOURCES_EXE) - - rm -f $@ - mv $@.tmp $@ - -$(PROFILE_OUT): $(PROFILE_EXE) - $(PROFILE_RUNTIME) $< > $@ 2>&1 diff --git a/mcs/build/profiles/build.make b/mcs/build/profiles/build.make index 4a4a9594c14..75ca353eefa 100644 --- a/mcs/build/profiles/build.make +++ b/mcs/build/profiles/build.make @@ -1,25 +1,127 @@ # -*- makefile -*- -BOOTSTRAP_PROFILE = basic -BUILD_TOOLS_PROFILE = basic +monolite_path := $(topdir)/class/lib/monolite-$(BUILD_PLATFORM)/$(MONO_CORLIB_VERSION) -BOOTSTRAP_MCS = MONO_PATH="$(topdir)/class/lib/$(BOOTSTRAP_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(INTERNAL_CSC) -MCS = $(BOOTSTRAP_MCS) +with_mono_path_monolite = MONO_PATH="$(monolite_path)$(PLATFORM_PATH_SEPARATOR)$(monolite_path)/Facades$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" -PLATFORMS = macos linux win32 unix +monolite_flag := $(depsdir)/use-monolite +use_monolite := $(wildcard $(monolite_flag)) -# nuttzing! +MONOLITE_MSCORLIB = $(monolite_path)/mscorlib.dll -profile-check: - @: +ifdef use_monolite +ifdef MCS_MODE + CSC_LOCATION = $(monolite_path)/mcs.exe +endif + +PROFILE_RUNTIME = $(with_mono_path_monolite) $(RUNTIME) +BOOTSTRAP_MCS = $(PROFILE_RUNTIME) $(RUNTIME_FLAGS) $(CSC_LOCATION) + +else +PROFILE_RUNTIME = $(EXTERNAL_RUNTIME) +ifdef MCS_MODE + BOOTSTRAP_MCS = mcs +else + BOOTSTRAP_MCS = $(PROFILE_RUNTIME) $(RUNTIME_FLAGS) $(CSC_LOCATION) +endif +endif + +# +# Special setup for boostrap tools which we want to run with system/monolite core libraries +# for all libraries build as part of this profile +# +ILASM = $(PROFILE_RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/tmp/ilasm.exe +STRING_REPLACER = $(PROFILE_RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/tmp/cil-stringreplacer.exe +GENSOURCES =$(PROFILE_RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/tmp/gensources.exe + +MCS = $(BOOTSTRAP_MCS) DEFAULT_REFERENCES = mscorlib -PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:MONO -d:WIN_PLATFORM -nowarn:1699 -nostdlib + +PROFILE_MCS_FLAGS = -d:NET_4_0 -d:NET_4_5 -d:MONO -d:WIN_PLATFORM -d:BOOTSTRAP_BASIC -nowarn:1699 -nostdlib API_BIN_PROFILE = v4.7.1 +BOOTSTRAP_BIN_PROFILE = v4.7 NO_SIGN_ASSEMBLY = yes NO_TEST = yes NO_INSTALL = yes - FRAMEWORK_VERSION = 4.5 +# Compiler all using same bootstrap compiler +LIBRARY_COMPILE = $(BOOT_COMPILE) + +# Verbose basic only +# V = 1 + +# +# Copy from rules.make because I don't know how to unset MCS_FLAGS +# +USE_MCS_FLAGS = /codepage:$(CODEPAGE) /nologo /noconfig /deterministic $(LOCAL_MCS_FLAGS) $(PLATFORM_MCS_FLAGS) $(PROFILE_MCS_FLAGS) $(MCS_FLAGS) + +.PHONY: profile-check do-profile-check +profile-check: + @: + +ifeq (.,$(thisdir)) +all-recursive: do-profile-check +all-local: post-profile-cleanup +clean-local: clean-profile +endif + +clean-profile: + -rm -f $(PROFILE_EXE) $(PROFILE_OUT) $(monolite_flag) + +post-profile-cleanup: + @rm -f $(monolite_flag) + +PROFILE_EXE = $(depsdir)/basic-profile-check.exe +PROFILE_OUT = $(PROFILE_EXE:.exe=.out) + +MAKE_Q=$(if $(V),,-s) + +do-profile-check: $(depsdir)/.stamp + @ok=:; \ + rm -f $(PROFILE_EXE) $(PROFILE_OUT); \ + if [ -z '$(MAKE_Q)' ] && [ -n '$(PROFILE_RUNTIME)' ]; then $(PROFILE_RUNTIME) --version; fi; \ + $(MAKE) $(MAKE_Q) $(PROFILE_OUT) || ok=false; \ + if $$ok; then rm -f $(PROFILE_EXE) $(PROFILE_OUT); else \ + if test ! -s $(MONOLITE_MSCORLIB); then \ + $(MAKE) $(MAKE_Q) do-get-monolite ; \ + fi; \ + if test -f $(MONOLITE_MSCORLIB); then \ + $(MAKE) $(MAKE_Q) do-profile-check-monolite ; \ + else \ + echo "*** The runtime '$(PROFILE_RUNTIME)' doesn't appear to be usable." 1>&2; \ + echo "*** Check README for information on how to bootstrap a Mono installation." 1>&2 ; \ + exit 1; fi; fi + + +ifdef use_monolite + +do-get-monolite: + +do-profile-check-monolite: + @echo "*** The contents of your 'monolite-$(BUILD_PLATFORM)/$(MONO_CORLIB_VERSION)' directory may be out-of-date" 1>&2 + @echo "*** You may want to try 'make get-monolite-latest'" 1>&2 + rm -f $(monolite_flag) + exit 1 + +else + +do-get-monolite: + @echo "*** Downloading bootstrap required 'monolite-$(BUILD_PLATFORM)/$(MONO_CORLIB_VERSION)'" 1>&2 + $(MAKE) $(MAKE_Q) -C $(topdir)/class get-monolite-latest + +do-profile-check-monolite: $(depsdir)/.stamp + @echo "*** The runtime '$(PROFILE_RUNTIME)' doesn't appear to be usable." 1>&2 + @echo "*** Trying the 'monolite-$(BUILD_PLATFORM)/$(MONO_CORLIB_VERSION)' directory." 1>&2 + @echo dummy > $(monolite_flag) + $(MAKE) do-profile-check + +endif + +$(PROFILE_EXE): $(topdir)/build/common/basic-profile-check.cs + $(BOOTSTRAP_MCS) /warn:0 /noconfig /langversion:latest /r:System.dll /r:mscorlib.dll /out:$@ $< + +$(PROFILE_OUT): $(PROFILE_EXE) + $(PROFILE_RUNTIME) $< > $@ 2>&1 diff --git a/mcs/build/rules.make b/mcs/build/rules.make index 6a84ac73dde..890d203ce2b 100644 --- a/mcs/build/rules.make +++ b/mcs/build/rules.make @@ -54,11 +54,9 @@ INTERNAL_CSC_LOCATION = $(CSC_LOCATION) INTERNAL_CSC = CSC_SDK_PATH_DISABLED= $(RUNTIME) $(RUNTIME_FLAGS) $(CSC_RUNTIME_FLAGS) $(INTERNAL_CSC_LOCATION) RESGEN = MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/resgen.exe -STRING_REPLACER = MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/tmp/cil-stringreplacer.exe +STRING_REPLACER = MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/cil-stringreplacer.exe ILASM = MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/ilasm.exe -GENSOURCES_LIBDIR = $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE) -GENSOURCES_CS = $(topdir)/build/gensources.cs -GENSOURCES_EXE = $(topdir)/build/gensources.exe +GENSOURCES = MONO_PATH="$(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) $(RUNTIME_FLAGS) $(topdir)/class/lib/$(BUILD_TOOLS_PROFILE)/gensources.exe depsdir = $(topdir)/build/deps @@ -74,9 +72,6 @@ export MKINSTALLDIRS export BOOTSTRAP_MCS export DESTDIR export RESGEN -export GENSOURCES_LIBDIR -export GENSOURCES_CS -export GENSOURCES_EXE # Get this so the platform.make platform-check rule doesn't become the # default target diff --git a/mcs/build/tests.make b/mcs/build/tests.make index a4e339035fa..e7faa6fe807 100644 --- a/mcs/build/tests.make +++ b/mcs/build/tests.make @@ -260,20 +260,10 @@ $(test_lib_output): $(test_assembly_dep) $(test_response) $(test_nunit_dep) $(te test_response_preprocessed = $(test_response)_preprocessed -ifneq "x" "x$(PROFILE_RUNTIME)" -GENSOURCES_RUNTIME=$(PROFILE_RUNTIME) -else -ifneq "x" "x$(TEST_RUNTIME)" -GENSOURCES_RUNTIME=$(TEST_RUNTIME) -else -GENSOURCES_RUNTIME=MONO_PATH="$(GENSOURCES_LIBDIR)$(PLATFORM_PATH_SEPARATOR)$$MONO_PATH" $(RUNTIME) -endif -endif - # This handles .excludes/.sources pairs, as well as resolving the # includes that occur in .sources files -$(test_response_preprocessed): $(test_sourcefile) $(wildcard *_test.dll.sources) $(wildcard *_test.dll.exclude.sources) $(GENSOURCES_CS) - $(GENSOURCES_RUNTIME) --debug $(GENSOURCES_EXE) --basedir:./Test --strict "$@" "$(test_sourcefile)" "$(test_sourcefile_excludes)" +$(test_response_preprocessed): $(test_sourcefile) $(wildcard *_test.dll.sources) $(wildcard *_test.dll.exclude.sources) + $(GENSOURCES) --basedir:./Test --strict --platformsdir:$(topdir)/build "$@" "$(test_sourcefile)" "$(test_sourcefile_excludes)" $(test_response): $(test_response_preprocessed) # @echo Creating $@ ... @@ -341,8 +331,8 @@ xtest_response_preprocessed = $(xtest_response)_preprocessed # This handles .excludes/.sources pairs, as well as resolving the # includes that occur in .sources files -$(xtest_response): $(xtest_sourcefile) $(wildcard *xtest.dll.sources) $(wildcard $(xtest_sourcefile_excludes)) $(GENSOURCES_CS) - $(GENSOURCES_RUNTIME) --debug $(GENSOURCES_EXE) --strict "$@" "$(xtest_sourcefile)" "$(xtest_sourcefile_excludes)" +$(xtest_response): $(xtest_sourcefile) $(wildcard *xtest.dll.sources) $(wildcard $(xtest_sourcefile_excludes)) + $(GENSOURCES) --strict --platformsdir:$(topdir)/build "$@" "$(xtest_sourcefile)" "$(xtest_sourcefile_excludes)" $(xtest_makefrag): $(xtest_response) @echo Creating $@ ... diff --git a/mcs/class/Makefile b/mcs/class/Makefile index 5efb81be494..46384add863 100644 --- a/mcs/class/Makefile +++ b/mcs/class/Makefile @@ -12,25 +12,6 @@ ifdef MCS_MODE MCS_MODE_dirs := Mono.Cecil.Mdb endif -# The minimal set of csc dependencies -basic_SUBDIRS := \ - Mono.Cecil \ - $(MCS_MODE_dirs) \ - ../tools/cil-stringreplacer \ - corlib \ - Mono.Security \ - System \ - System.XML \ - System.Security \ - System.Core \ - System.ComponentModel.Composition.4.5 \ - System.Numerics \ - System.Xml.Linq \ - Mono.CompilerServices.SymbolWriter \ - PEAPI \ - ../ilasm \ - corlib/il - # Tooling dependencies of mscorlib, we build them to /tmp folder for MONO_PATH to work # reliably for clean and update builds. All deps are built against stable API to run with # range of boostrap versions and .NET at the same time @@ -38,6 +19,8 @@ build_SUBDIRS = \ Mono.Cecil \ $(MCS_MODE_dirs) \ ../tools/cil-stringreplacer \ + PEAPI \ + ../ilasm \ corlib build_PARALLEL_SUBDIRS = \ @@ -52,9 +35,7 @@ build_PARALLEL_SUBDIRS = \ System.Numerics \ System.Xml.Linq \ System.IO.Compression \ - System.Drawing \ - Mono.CompilerServices.SymbolWriter \ - PEAPI + System.Drawing ifdef MCS_MODE basic_PARALLEL_SUBDIRS := ../mcs @@ -65,7 +46,8 @@ build_SUBDIRS += \ System.XML \ System.Security \ Mono.Posix \ - System.Core + System.Core \ + Mono.CompilerServices.SymbolWriter build_PARALLEL_SUBDIRS += ../mcs endif diff --git a/mcs/class/Mono.Cecil.Mdb/Makefile b/mcs/class/Mono.Cecil.Mdb/Makefile index 1303411bfdc..c24284631b7 100644 --- a/mcs/class/Mono.Cecil.Mdb/Makefile +++ b/mcs/class/Mono.Cecil.Mdb/Makefile @@ -5,17 +5,14 @@ LIBRARY = Mono.Cecil.Mdb.dll KEYFILE = ../mono.snk LIBRARY_PACKAGE = none -API_BUILD := $(filter basic build, $(PROFILE)) +API_BUILD := $(filter build, $(PROFILE)) ifdef API_BUILD -DEFAULT_REFERENCES = -API_BIN_REFS = System mscorlib +TARGET_NET_REFERENCE = $(BOOTSTRAP_BIN_PROFILE) LIBRARY_USE_INTERMEDIATE_FILE = 1 -else -LIB_REFS = System endif -LIB_REFS += Mono.Cecil +LIB_REFS = System Mono.Cecil LIB_MCS_FLAGS = -d:CECIL diff --git a/mcs/class/Mono.Cecil/Makefile b/mcs/class/Mono.Cecil/Makefile index 76e08539a05..4fe84c6faee 100644 --- a/mcs/class/Mono.Cecil/Makefile +++ b/mcs/class/Mono.Cecil/Makefile @@ -5,14 +5,13 @@ LIBRARY = Mono.Cecil.dll KEYFILE = ../mono.snk LIBRARY_PACKAGE = none -API_BUILD := $(filter basic build, $(PROFILE)) +LIB_REFS = System.Core System + +API_BUILD := $(filter build, $(PROFILE)) ifdef API_BUILD -DEFAULT_REFERENCES = -API_BIN_REFS = System.Core System mscorlib +TARGET_NET_REFERENCE = $(BOOTSTRAP_BIN_PROFILE) LIBRARY_USE_INTERMEDIATE_FILE = 1 -else -LIB_REFS = System.Core System endif LIB_MCS_FLAGS = -d:NET_4_0 diff --git a/mcs/class/PEAPI/Makefile b/mcs/class/PEAPI/Makefile index 1a1c4cd83e6..84ff98691fb 100644 --- a/mcs/class/PEAPI/Makefile +++ b/mcs/class/PEAPI/Makefile @@ -3,9 +3,21 @@ SUBDIRS = include ../../build/rules.make LIBRARY = PEAPI.dll +LIB_MCS_FLAGS = -nowarn:414,618 + LIB_REFS = System + +API_BUILD := $(filter build, $(PROFILE)) + +ifdef API_BUILD +TARGET_NET_REFERENCE = $(BOOTSTRAP_BIN_PROFILE) +LIBRARY_USE_INTERMEDIATE_FILE = 1 +else +LIB_MCS_FLAGS += -d:HAS_MONO_SECURITY +LIB_REFS += Mono.Security +endif + KEYFILE = ../mono.pub -LIB_MCS_FLAGS = -nowarn:414,618 NO_TEST = yes EXTRA_DISTFILES = README.txt diff --git a/mcs/class/PEAPI/PEAPI.csproj b/mcs/class/PEAPI/PEAPI.csproj index 2b8f905582b..b4a30696a7e 100644 --- a/mcs/class/PEAPI/PEAPI.csproj +++ b/mcs/class/PEAPI/PEAPI.csproj @@ -28,7 +28,7 @@ <PropertyGroup Condition=" '$(Platform)' == 'net_4_x' ">
<OutputPath>./../../class/lib/net_4_x-$(HostPlatform)</OutputPath>
<IntermediateOutputPath>./../../class/obj/$(AssemblyName)-net_4_x-$(HostPlatform)</IntermediateOutputPath>
- <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM</DefineConstants>
+ <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM;HAS_MONO_SECURITY</DefineConstants>
</PropertyGroup>
<!-- @ALL_PROFILE_PROPERTIES@ -->
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
@@ -65,6 +65,7 @@ <!-- @COMMON_PROJECT_REFERENCES@ -->
<ItemGroup Condition=" '$(Platform)' == 'net_4_x' ">
<ProjectReference Include="../System/System.csproj" />
+ <ProjectReference Include="../Mono.Security/Mono.Security.csproj" />
<ProjectReference Include="../corlib/corlib.csproj" />
</ItemGroup>
<!-- @ALL_REFERENCES@ -->
diff --git a/mcs/class/System.ComponentModel.Composition.4.5/Makefile b/mcs/class/System.ComponentModel.Composition.4.5/Makefile index 669d96cb24c..2b9e35cfb9f 100644 --- a/mcs/class/System.ComponentModel.Composition.4.5/Makefile +++ b/mcs/class/System.ComponentModel.Composition.4.5/Makefile @@ -5,7 +5,7 @@ include ../../build/rules.make LIBRARY = System.ComponentModel.Composition.dll LIB_REFS = System System.Core -NO_RESGEN := $(filter basic build, $(PROFILE)) +NO_RESGEN := $(filter build, $(PROFILE)) ifndef NO_RESGEN RESOURCE_DEFS = Microsoft.Internal.Strings,src/ComponentModel/Strings.resx endif diff --git a/mcs/class/System.Xml.Linq/Makefile b/mcs/class/System.Xml.Linq/Makefile index ef181ce0f2b..3a7883b5683 100644 --- a/mcs/class/System.Xml.Linq/Makefile +++ b/mcs/class/System.Xml.Linq/Makefile @@ -6,7 +6,7 @@ LIBRARY = System.Xml.Linq.dll LIB_REFS = System System.Core System.Xml LIB_MCS_FLAGS = -unsafe -nowarn:436 -NO_SERIALIZATION_PROFILE := $(filter basic build, $(PROFILE)) +NO_SERIALIZATION_PROFILE := $(filter build, $(PROFILE)) ifndef NO_SERIALIZATION_PROFILE LIB_REFS += System.Runtime.Serialization LIB_MCS_FLAGS += -d:FEATURE_SERIALIZATION diff --git a/mcs/ilasm/Driver.cs b/mcs/ilasm/Driver.cs index fc2e213bc87..dc4929d79d4 100644 --- a/mcs/ilasm/Driver.cs +++ b/mcs/ilasm/Driver.cs @@ -14,7 +14,9 @@ using System.IO; using System.Reflection; using System.Collections; using System.Security.Cryptography; +#if HAS_MONO_SECURITY using Mono.Security; +#endif namespace Mono.ILASM { @@ -52,7 +54,9 @@ namespace Mono.ILASM { private CodeGen codegen; private bool keycontainer = false; private string keyname; +#if HAS_MONO_SECURITY private StrongName sn; +#endif bool noautoinherit; public DriverMain (string[] args) @@ -84,9 +88,13 @@ namespace Mono.ILASM { // if we have a key and aren't assembling a netmodule if ((keyname != null) && !codegen.IsThisAssembly (null)) { +#if HAS_MONO_SECURITY LoadKey (); // this overrides any attribute or .publickey directive in the source codegen.ThisAssembly.SetPublicKey (sn.PublicKey); +#else + throw new NotSupportedException (); +#endif } try { @@ -103,6 +111,7 @@ namespace Mono.ILASM { return false; } +#if HAS_MONO_SECURITY try { if (sn != null) { Report.Message ("Signing assembly with the specified strongname keypair"); @@ -111,6 +120,7 @@ namespace Mono.ILASM { } catch { return false; } +#endif return true; } @@ -121,6 +131,7 @@ namespace Mono.ILASM { Console.WriteLine ("***** FAILURE *****\n"); } +#if HAS_MONO_SECURITY private void LoadKey () { if (keycontainer) { @@ -146,6 +157,7 @@ namespace Mono.ILASM { // exists return sn.Sign (filename); } +#endif private void ProcessFile (string file_path) { diff --git a/mcs/ilasm/Makefile b/mcs/ilasm/Makefile index 4ca11545781..434764e55af 100644 --- a/mcs/ilasm/Makefile +++ b/mcs/ilasm/Makefile @@ -4,7 +4,17 @@ include ../build/rules.make PROGRAM = ilasm.exe BUILT_SOURCES = ILParser.cs -LIB_REFS = PEAPI Mono.CompilerServices.SymbolWriter Mono.Security + +LIB_REFS = PEAPI System + +API_BUILD := $(filter build, $(PROFILE)) +ifdef API_BUILD +TARGET_NET_REFERENCE = $(BOOTSTRAP_BIN_PROFILE) +PROGRAM_USE_INTERMEDIATE_FILE = 1 +else +LIB_REFS += Mono.Security +LOCAL_MCS_FLAGS += -d:HAS_MONO_SECURITY +endif CLEAN_FILES = parser/y.output diff --git a/mcs/ilasm/ilasm.csproj b/mcs/ilasm/ilasm.csproj index 5a30767d5f8..5e3fd37e5d8 100644 --- a/mcs/ilasm/ilasm.csproj +++ b/mcs/ilasm/ilasm.csproj @@ -26,7 +26,7 @@ <PropertyGroup Condition=" '$(Platform)' == 'net_4_x' ">
<OutputPath>./../class/lib/net_4_x-$(HostPlatform)</OutputPath>
<IntermediateOutputPath>./../class/obj/$(AssemblyName)-net_4_x-$(HostPlatform)</IntermediateOutputPath>
- <DefineConstants>NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM</DefineConstants>
+ <DefineConstants>HAS_MONO_SECURITY;NET_4_0;NET_4_5;NET_4_6;MONO;WIN_PLATFORM</DefineConstants>
</PropertyGroup>
<!-- @ALL_PROFILE_PROPERTIES@ -->
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
@@ -48,6 +48,11 @@ <!--Common files-->
<ItemGroup>
<Compile Include="..\build\common\Consts.cs" />
+ <Compile Include="..\class\Mono.CompilerServices.SymbolWriter\MonoSymbolFile.cs" />
+ <Compile Include="..\class\Mono.CompilerServices.SymbolWriter\MonoSymbolTable.cs" />
+ <Compile Include="..\class\Mono.CompilerServices.SymbolWriter\MonoSymbolWriter.cs" />
+ <Compile Include="..\class\Mono.CompilerServices.SymbolWriter\SourceMethodBuilder.cs" />
+ <Compile Include="..\class\Mono.CompilerServices.SymbolWriter\SymbolWriterImpl.cs" />
<Compile Include="AssemblyInfo.cs" />
<Compile Include="Driver.cs" />
<Compile Include="Report.cs" />
@@ -153,7 +158,7 @@ <!-- @COMMON_PROJECT_REFERENCES@ -->
<ItemGroup Condition=" '$(Platform)' == 'net_4_x' ">
<ProjectReference Include="../class/PEAPI/PEAPI.csproj" />
- <ProjectReference Include="../class/Mono.CompilerServices.SymbolWriter/Mono.CompilerServices.SymbolWriter.csproj" />
+ <ProjectReference Include="../class/System/System.csproj" />
<ProjectReference Include="../class/Mono.Security/Mono.Security.csproj" />
</ItemGroup>
<!-- @ALL_REFERENCES@ -->
diff --git a/mcs/ilasm/ilasm.exe.sources b/mcs/ilasm/ilasm.exe.sources index bb93d163183..e03ff3f52ae 100644 --- a/mcs/ilasm/ilasm.exe.sources +++ b/mcs/ilasm/ilasm.exe.sources @@ -84,3 +84,9 @@ scanner/NumberHelper.cs scanner/StringHelperBase.cs scanner/StringHelper.cs ../build/common/Consts.cs + +../class/Mono.CompilerServices.SymbolWriter/MonoSymbolFile.cs +../class/Mono.CompilerServices.SymbolWriter/SourceMethodBuilder.cs +../class/Mono.CompilerServices.SymbolWriter/MonoSymbolTable.cs +../class/Mono.CompilerServices.SymbolWriter/SymbolWriterImpl.cs +../class/Mono.CompilerServices.SymbolWriter/MonoSymbolWriter.cs
\ No newline at end of file diff --git a/mcs/tools/Makefile b/mcs/tools/Makefile index e3782fc902a..891d8c32c4c 100644 --- a/mcs/tools/Makefile +++ b/mcs/tools/Makefile @@ -59,7 +59,7 @@ monotouch_SUBDIRS = nunit-lite net_4_x_SUBDIRS = net_4_x_PARALLEL_SUBDIRS = $(net_4_5_dirs) -DIST_SUBDIRS = $(net_4_5_dirs) cil-stringreplacer commoncryptogenerator resx2sr +DIST_SUBDIRS = $(net_4_5_dirs) cil-stringreplacer commoncryptogenerator resx2sr gensources include ../build/rules.make diff --git a/mcs/tools/cil-stringreplacer/Makefile b/mcs/tools/cil-stringreplacer/Makefile index ac4721cafeb..40ea35dad58 100644 --- a/mcs/tools/cil-stringreplacer/Makefile +++ b/mcs/tools/cil-stringreplacer/Makefile @@ -5,14 +5,8 @@ include ../../build/rules.make PROGRAM = cil-stringreplacer.exe NO_INSTALL = yes -API = $(filter basic build, $(PROFILE)) -ifdef API -# It can be run using system .net during boostrap -TARGET_NET_REFERENCE = v4.6 -# Trick to make it work during boostrap where it has to run with system -# assemblies not the ones in lib/basic folder +TARGET_NET_REFERENCE = $(BOOTSTRAP_BIN_PROFILE) PROGRAM_USE_INTERMEDIATE_FILE = 1 -endif LIB_REFS = System Mono.Cecil diff --git a/mcs/tools/gensources/Makefile b/mcs/tools/gensources/Makefile new file mode 100644 index 00000000000..21213ba6787 --- /dev/null +++ b/mcs/tools/gensources/Makefile @@ -0,0 +1,12 @@ +thisdir = tools/gensources +SUBDIRS = +include ../../build/rules.make + +PROGRAM = gensources.exe +NO_INSTALL = yes + +TARGET_NET_REFERENCE = $(BOOTSTRAP_BIN_PROFILE) +PROGRAM_USE_INTERMEDIATE_FILE = 1 +LIB_REFS = System System.Core + +include ../../build/executable.make diff --git a/mcs/build/gensources.cs b/mcs/tools/gensources/gensources.cs index b41e15e2cde..1f23bbe735a 100644 --- a/mcs/build/gensources.cs +++ b/mcs/tools/gensources/gensources.cs @@ -10,6 +10,7 @@ public static class Program { var args = new List<string> (_args); bool useStdout = false, showHelp = false, strictMode = false; string baseDir = null; + string platformsDir = null; for (int i = 0; i < args.Count; i++) { var arg = args[i]; @@ -44,6 +45,9 @@ public static class Program { case "--basedir": baseDir = argValue; break; + case "--platformsdir": + platformsDir = argValue; + break; default: Console.Error.WriteLine ($"// Unrecognized switch {arg}. Aborting."); return 1; @@ -71,6 +75,9 @@ public static class Program { Console.Error.WriteLine (" Produces an error exit code if files or directories are invalid/missing or other warnings occur"); Console.Error.WriteLine ("--basedir:<dir>"); Console.Error.WriteLine (" Sets the base directory when reading a single sources/exclusions pair (default is the directory containing the sources file)"); + Console.Error.WriteLine ("--platformsdir:<dir>"); + Console.Error.WriteLine (" Location of platforms directory with configurations"); + return 1; } @@ -81,8 +88,8 @@ public static class Program { var outFile = Path.GetFullPath (args[0]); - var platformsFolder = Path.Combine (executableDirectory, "platforms"); - var profilesFolder = Path.Combine (executableDirectory, "profiles"); + var platformsFolder = Path.Combine (platformsDir ?? executableDirectory, "platforms"); + var profilesFolder = Path.Combine (platformsDir ?? executableDirectory, "profiles"); if (!Directory.Exists (platformsFolder) || !Directory.Exists (profilesFolder)) { Console.Error.WriteLine ($"// Platforms and/or profiles folders are missing: '{platformsFolder}' '{profilesFolder}'. Aborting."); return 1; diff --git a/mcs/tools/gensources/gensources.exe.sources b/mcs/tools/gensources/gensources.exe.sources new file mode 100644 index 00000000000..ec7a614f400 --- /dev/null +++ b/mcs/tools/gensources/gensources.exe.sources @@ -0,0 +1 @@ +gensources.cs
\ No newline at end of file diff --git a/msvc/scripts/Makefile b/msvc/scripts/Makefile index aae608c6f95..2b23c3b5308 100644 --- a/msvc/scripts/Makefile +++ b/msvc/scripts/Makefile @@ -1,9 +1,9 @@ all: genproj.exe prepare.exe mono --debug genproj.exe -genproj.exe: genproj.cs ../../mcs/build/gensources.cs +genproj.exe: genproj.cs ../../mcs/tools/gensources/gensources.cs -rm $@ - csc -debug:portable genproj.cs ../../mcs/build/gensources.cs -main:Driver -r:System.dll -r:System.Core.dll -out:$@ + csc -debug:portable $^ -main:Driver -r:System.dll -r:System.Core.dll -out:$@ prepare.exe: prepare.cs csc prepare.cs |