diff --git a/build_rts.py b/build_rts.py index efcff30c..05c37eb2 100755 --- a/build_rts.py +++ b/build_rts.py @@ -84,7 +84,8 @@ from x86_64 import X8664Generic # native -from native import Aarch64Native, X86Native, X8664Native +from linux import Aarch64Linux, X86Linux, X8664Linux +from windows import X86Windows, X8664Windows # vx7r2cert from vx7r2cert import ( @@ -282,12 +283,16 @@ def build_configs(target): elif target == "x86_64": t = X8664Generic() # native platforms - elif target in ("x86-linux", "x86-windows"): - t = X86Native(target) - elif target in ("x86_64-linux", "x86_64-windows", "x86_64-windows64"): - t = X8664Native(target) - elif target in ("aarch64-linux",): - t = Aarch64Native(target) + elif target == "aarch64-linux": + t = Aarch64Linux() + elif target == "x86-linux": + t = X86Linux() + elif target == "x86_64-linux": + t = X8664Linux() + elif target == "x86-windows": + t = X86Windows() + elif target in ("x86_64-windows", "x86_64-windows64"): + t = X8664Windows() # vx7r2cert elif target == "aarch64-vx7r2cert": t = AArch64Vx7r2Cert() diff --git a/native/__init__.py b/linux/__init__.py similarity index 60% rename from native/__init__.py rename to linux/__init__.py index 28ba6e2c..9f7bb6d3 100644 --- a/native/__init__.py +++ b/linux/__init__.py @@ -1,23 +1,18 @@ from support.bsp_sources.target import DFBBTarget -class Native(DFBBTarget): - def __init__(self, target): +class Linux(DFBBTarget): + def __init__(self): super().__init__() self.add_gnat_sources("src/s-macres__native.adb") - # Use the bb source of s-textio for Windows as a custom - # source profile is not yet supported. - # eng/toolchain/bb-runtimes#78 - if "windows" in target: - self.add_gnat_sources("src/s-textio__stdio.adb") - - @property - def target(self): - return None def has_libc(self, profile): return True + @property + def name(self): + return self.target + def dump_runtime_xml(self, rts_name, rts): return ( '\n' @@ -27,24 +22,25 @@ def dump_runtime_xml(self, rts_name, rts): "\n" ) - def amend_rts(self, rts_profile, cfg): - super().amend_rts(rts_profile, cfg) + @property + def is_legacy_format(self): + return True -class X86Native(Native): +class X86Linux(Linux): @property - def name(self): - return "native-x86" + def target(self): + return "x86-linux" @property def system_ads(self): return {"light": "system-native-x86-light.ads"} -class X8664Native(Native): +class X8664Linux(Linux): @property - def name(self): - return "native-x86_64" + def target(self): + return "x86_64-linux" @property def is_64bit(self): @@ -55,10 +51,10 @@ def system_ads(self): return {"light": "system-native-x86-light.ads"} -class Aarch64Native(Native): +class Aarch64Linux(Linux): @property - def name(self): - return "native-aarch64" + def target(self): + return "aarch64-linux" @property def is_64bit(self): diff --git a/windows/__init__.py b/windows/__init__.py new file mode 100644 index 00000000..4e7ce7a1 --- /dev/null +++ b/windows/__init__.py @@ -0,0 +1,51 @@ +from support.bsp_sources.target import DFBBTarget + + +class Windows(DFBBTarget): + def __init__(self): + super().__init__() + self.add_gnat_sources("src/s-macres__native.adb", "src/s-textio__stdio.adb") + + @property + def name(self): + return self.target + + def has_libc(self, profile): + return True + + def dump_runtime_xml(self, rts_name, rts): + return ( + '\n' + "\n" + " \n" + " \n" + "\n" + ) + + @property + def is_legacy_format(self): + return True + + +class X86Windows(Windows): + @property + def target(self): + return "x86-windows" + + @property + def system_ads(self): + return {"light": "system-native-x86-light.ads"} + + +class X8664Windows(Windows): + @property + def target(self): + return "x86_64-windows" + + @property + def is_64bit(self): + return True + + @property + def system_ads(self): + return {"light": "system-native-x86-light.ads"}