BCL: Fix net_4_x build for Windows

This commit is contained in:
Ignacio Etcheverry 2020-01-29 12:27:35 +01:00
parent 7e3e21defc
commit 2f0a47c7ed
4 changed files with 27 additions and 3 deletions

View File

@ -87,6 +87,9 @@ _AOT cross-compilers for WebAssembly cannot be built with this script yet._
# Build the Desktop BCL.
./bcl.py make --product=desktop
# Build the Desktop BCL for Windows.
./bcl.py make --product=desktop-win32
# Build the Android BCL.
./bcl.py make --product=android

11
bcl.py
View File

@ -11,14 +11,16 @@ from options import *
from os_utils import *
product_values = ['desktop', 'android', 'wasm']
product_values = ['desktop', 'desktop-win32', 'android', 'wasm']
profiles_table = {
'desktop': ['net_4_x'],
'desktop-win32': ['net_4_x'],
'android': ['monodroid', 'monodroid_tools'],
'wasm': ['wasm', 'wasm_tools']
}
test_profiles_table = {
'desktop': [],
'desktop-win32': [],
'android': ['monodroid', 'monodroid_tools'],
'wasm': ['wasm']
}
@ -97,6 +99,10 @@ def make_product(opts: BclOpts, product: str):
make_args = ['-C', build_dir, '-C', 'runtime', 'all-mcs', 'build_profiles=%s' % ' '.join(profiles)]
make_args += ['V=1'] if opts.verbose_make else []
if product == 'desktop-win32':
make_args += ['PROFILE_PLATFORM=win32'] # Requires patch: 'bcl-profile-platform-override.diff'
run_command('make', args=make_args, name='make profiles')
if opts.tests and len(test_profiles) > 0:
@ -107,7 +113,8 @@ def make_product(opts: BclOpts, product: str):
# Copy the bcl profiles to the output directory
from distutils.dir_util import copy_tree
for profile in profiles:
copy_tree('%s/mcs/class/lib/%s' % (opts.mono_source_root, profile), '%s/%s' % (install_dir, profile))
profile_dir = profile + '-win32' if product == 'desktop-win32' else profile
copy_tree('%s/mcs/class/lib/%s' % (opts.mono_source_root, profile_dir), '%s/%s' % (install_dir, profile_dir))
# Remove unneeded files
import glob

View File

@ -0,0 +1,13 @@
diff --git a/mcs/build/rules.make b/mcs/build/rules.make
index e57a636ef4d..60c60a8fc17 100644
--- a/mcs/build/rules.make
+++ b/mcs/build/rules.make
@@ -94,7 +94,7 @@ include $(topdir)/build/config-default.make
include $(topdir)/build/platforms/$(BUILD_PLATFORM).make
-PROFILE_PLATFORM = $(if $(PLATFORMS),$(if $(filter $(PLATFORMS),$(HOST_PLATFORM)),$(HOST_PLATFORM),$(error Unknown platform "$(HOST_PLATFORM)" for profile "$(PROFILE)")))
+PROFILE_PLATFORM ?= $(if $(PLATFORMS),$(if $(filter $(PLATFORMS),$(HOST_PLATFORM)),$(HOST_PLATFORM),$(error Unknown platform "$(HOST_PLATFORM)" for profile "$(PROFILE)")))
PROFILE_DIRECTORY = $(PROFILE)$(if $(PROFILE_PLATFORM),-$(PROFILE_PLATFORM))
# Useful

View File

@ -27,7 +27,8 @@ def main(raw_args):
patches = [
'fix-mono-android-tkill.diff',
'mono-dbg-agent-clear-tls-instead-of-abort.diff'
'mono-dbg-agent-clear-tls-instead-of-abort.diff',
'bcl-profile-platform-override.diff'
]
from subprocess import Popen