summaryrefslogtreecommitdiff
path: root/tools
diff options
context:
space:
mode:
authorTal Hayon <talhayon1@gmail.com>2023-01-14 08:18:31 +0200
committerTal Hayon <talhayon1@gmail.com>2023-01-14 08:18:31 +0200
commite8b4775fe08421ab522fec06aea337a88bce9949 (patch)
treeb039855d9c492c92d9551836df623254a0941394 /tools
parentfb71366a769abb076428b8b6aa846a8c566b5be6 (diff)
WSL compilation fixes
Diffstat (limited to 'tools')
-rw-r--r--tools/tp.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/tools/tp.py b/tools/tp.py
index 9245f21ee7..a62a7ae68c 100644
--- a/tools/tp.py
+++ b/tools/tp.py
@@ -12,6 +12,8 @@ import json
import subprocess
import multiprocessing as mp
import shutil
+import platform
+import stat
from dataclasses import dataclass, field
from typing import Dict, List, Set, Tuple
@@ -167,6 +169,16 @@ def setup(debug: bool, game_path: Path, tools_path: Path):
)
sys.exit(1)
+ c125 = compilers.joinpath("1.2.5")
+ if not c125.exists() or not c125.is_dir():
+ LOG.error(
+ (
+ f"Unable to find MWCC compiler version 1.2.5: missing directory '{c125}'\n"
+ f"Check the README for instructions on how to obtain the compilers"
+ )
+ )
+ sys.exit(1)
+
c27_lmgr326b = c27.joinpath("Lmgr326b.dll")
if not c27_lmgr326b.exists() or not c27_lmgr326b.is_file():
c27_lmgr326b = c27.joinpath("lmgr326b.dll")
@@ -188,6 +200,11 @@ def setup(debug: bool, game_path: Path, tools_path: Path):
LOG.debug(f"copy: '{c27_lmgr326b}', to: '{c27_lmgr326b_cc}'")
shutil.copy(c27_lmgr326b, c27_lmgr326b_cc)
+ c125_lmgr326b_cc = c125.joinpath("LMGR326B.dll")
+ if not c125_lmgr326b_cc.exists() or not c125_lmgr326b_cc.is_file():
+ LOG.debug(f"copy: '{c27_lmgr326b}', to: '{c125_lmgr326b_cc}'")
+ shutil.copy(c27_lmgr326b, c125_lmgr326b_cc)
+
c27_mwcceppc = c27.joinpath("mwcceppc.exe")
if not c27_mwcceppc.exists() or not c27_mwcceppc.is_file():
LOG.error(
@@ -231,6 +248,8 @@ def setup(debug: bool, game_path: Path, tools_path: Path):
else:
data[0x001C6A54] = 0x69
dst_file.write(data)
+ if platform.system() == "Linux":
+ os.chmod(dst, stat.S_IRWXU | stat.S_IRGRP | stat.S_IXGRP | stat.S_IROTH | stat.S_IXOTH)
if mwcceppc_sha1 == MWCCEPPC_SHA1:
LOG.debug(f"found original compiler: '{c27_mwcceppc}' ('{mwcceppc_sha1}')")