summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesonbuild/backend/backends.py2
-rw-r--r--mesonbuild/envconfig.py2
-rw-r--r--mesonbuild/programs.py5
3 files changed, 7 insertions, 2 deletions
diff --git a/mesonbuild/backend/backends.py b/mesonbuild/backend/backends.py
index 7fba3f3fb..de41ea171 100644
--- a/mesonbuild/backend/backends.py
+++ b/mesonbuild/backend/backends.py
@@ -593,7 +593,7 @@ class Backend:
else:
if exe_cmd[0].endswith('.jar'):
exe_cmd = ['java', '-jar'] + exe_cmd
- elif exe_cmd[0].endswith('.exe') and not (mesonlib.is_windows() or mesonlib.is_cygwin() or mesonlib.is_wsl()):
+ elif exe_cmd[0].endswith('.exe') and not (mesonlib.is_windows() or mesonlib.is_cygwin() or mesonlib.is_wsl() or machine.is_os2()):
exe_cmd = ['mono'] + exe_cmd
exe_wrapper = None
diff --git a/mesonbuild/envconfig.py b/mesonbuild/envconfig.py
index 161ffff21..dd050b011 100644
--- a/mesonbuild/envconfig.py
+++ b/mesonbuild/envconfig.py
@@ -392,7 +392,7 @@ class MachineInfo(HoldableObject):
# static libraries, and executables.
# Versioning is added to these names in the backends as-needed.
def get_exe_suffix(self) -> str:
- if self.is_windows() or self.is_cygwin():
+ if self.is_windows() or self.is_cygwin() or self.is_os2():
return 'exe'
else:
return ''
diff --git a/mesonbuild/programs.py b/mesonbuild/programs.py
index 0abf09720..a1cfc06e9 100644
--- a/mesonbuild/programs.py
+++ b/mesonbuild/programs.py
@@ -322,6 +322,11 @@ class ExternalProgram(mesonlib.HoldableObject):
paths = OrderedSet(path.split(os.pathsep)).difference(exclude_paths)
path = os.pathsep.join(paths)
command = shutil.which(name, path=path)
+ if not command and mesonlib.is_os2():
+ for ext in ['exe', 'cmd']:
+ command = shutil.which(f'{name}.{ext}', path=path)
+ if command:
+ return [command]
if mesonlib.is_windows():
return self._search_windows_special_cases(name, command, exclude_paths)
# On UNIX-like platforms, shutil.which() is enough to find