From 1822bca8900d2b35b97d5c119c418fc72459a16d Mon Sep 17 00:00:00 2001 From: Marco Rodolfi Date: Sat, 11 Jan 2025 17:54:09 +0100 Subject: [PATCH] [BUILD] Fix build test generation for Linux systems This allows a Linux system to generate all the PPC tests just by running ./xb gentests as on a Windows system. Tested locally. --- xenia-build | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) diff --git a/xenia-build b/xenia-build index 9d070e557..2f02b4d5e 100755 --- a/xenia-build +++ b/xenia-build @@ -17,6 +17,7 @@ import re import shutil import subprocess import sys +import stat __author__ = 'ben.vanik@gmail.com (Ben Vanik)' @@ -1279,12 +1280,25 @@ class GenTestsCommand(Command): print('Generating test binaries...') print('') - binutils_path = os.path.join('third_party', 'binutils-ppc-cygwin') + if sys.platform == 'win32': + binutils_path = os.path.join('third_party', 'binutils-ppc-cygwin') + else: + binutils_path = os.path.join('third_party', 'binutils', 'bin') + ppc_as = os.path.join(binutils_path, 'powerpc-none-elf-as') ppc_ld = os.path.join(binutils_path, 'powerpc-none-elf-ld') ppc_objdump = os.path.join(binutils_path, 'powerpc-none-elf-objdump') ppc_nm = os.path.join(binutils_path, 'powerpc-none-elf-nm') + if not os.path.exists(ppc_as) and sys.platform == 'linux': + print('Binaries are missing, binutils build required') + print('') + shell_script = os.path.join('third_party', 'binutils', 'build.sh') + # Set executable bit for build script before running it + os.chmod(shell_script, stat.S_IRUSR | stat.S_IWUSR | + stat.S_IXUSR | stat.S_IRGRP | stat.S_IROTH) + shell_call([shell_script]) + test_src = os.path.join('src', 'xenia', 'cpu', 'ppc', 'testing') test_bin = os.path.join(test_src, 'bin')