summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
Diffstat (limited to 'tools')
-rw-r--r--tools/makerel.py24
-rw-r--r--tools/tp.py4
-rwxr-xr-xtools/transform-dep.py15
3 files changed, 37 insertions, 6 deletions
diff --git a/tools/makerel.py b/tools/makerel.py
index 763ce1726d..4ed4fb3050 100644
--- a/tools/makerel.py
+++ b/tools/makerel.py
@@ -583,5 +583,27 @@ def load_elfs(str_paths):
return static, plfs
+def convert_arg_line_to_args(arg_line: str):
+ return arg_line.split(' ')
+
+
+def _read_args_from_files(args: List[str]):
+ new_args: List[str] = []
+ for arg in args:
+ if not arg or arg[0] != '@':
+ new_args.append(arg)
+ else:
+ with open(arg[1:], 'r') as file:
+ file_args: List[str] = []
+ for line in file:
+ for file_arg in convert_arg_line_to_args(line.strip()):
+ file_args.append(file_arg)
+ file_args = _read_args_from_files(file_args)
+ new_args.extend(file_args)
+
+ return new_args
+
+
if __name__ == "__main__":
- makerel()
+ args = _read_args_from_files(sys.argv[1:])
+ makerel(args)
diff --git a/tools/tp.py b/tools/tp.py
index b268efdd25..35ca7bb12a 100644
--- a/tools/tp.py
+++ b/tools/tp.py
@@ -247,7 +247,7 @@ def setup(debug: bool, game_path: Path, tools_path: Path):
c27_mwcceppc_old = c27.joinpath("mwcceppc.old.exe")
c27_mwcceppc_orignal = c27.joinpath("mwcceppc.exe")
- c27_mwcceppc_patched = c27.joinpath("mwcceppc_patched.exe")
+ c27_mwcceppc_patched = c27.joinpath("mwcceppc_modded.exe")
def patch_compiler(src: Path, dst: Path, apply: bool):
with src.open("rb") as src_file:
@@ -803,7 +803,7 @@ def remove_unused_asm(check: bool):
@click.option("--debug/--no-debug")
@click.option(
"--rels",
- default=False,
+ default=True,
is_flag=True,
help="RELs will also be build and checked",
)
diff --git a/tools/transform-dep.py b/tools/transform-dep.py
index bdb29e5013..412e3bd61d 100755
--- a/tools/transform-dep.py
+++ b/tools/transform-dep.py
@@ -9,7 +9,9 @@ if os.name != 'nt':
winedevices = os.path.join(wineprefix, 'dosdevices')
def in_wsl() -> bool:
- return 'microsoft-standard' in uname().release
+ # wsl1 has Microsoft, wsl2 has microsoft-standard
+ release = uname().release
+ return 'microsoft-standard' in release or 'Microsoft' in release
def import_d_file(in_file) -> str:
out_lines = []
@@ -36,8 +38,15 @@ def import_d_file(in_file) -> str:
# shortcut for z:
path = path[2:].replace('\\', '/')
elif in_wsl():
- path = path[0:1] + path[2:]
- path = os.path.join('/mnt', path.replace('\\', '/'))
+ if path.startswith(r'\\wsl'):
+ # first part could be wsl$ or wsl.localhost
+ pos = path.find('\\', 2)
+ pos = path.find('\\', pos + 1)
+ path = path[pos:]
+ path = path.replace('\\', '/')
+ else:
+ path = path[0:1] + path[2:]
+ path = os.path.join('/mnt', path.replace('\\', '/'))
else:
# use $WINEPREFIX/dosdevices to resolve path
path = os.path.realpath(os.path.join(winedevices, path.replace('\\', '/')))