diff --git a/third_party/binutils/build.sh b/third_party/binutils/build.sh old mode 100644 new mode 100755 index 21a119ce5b..6c9d83cdb6 --- a/third_party/binutils/build.sh +++ b/third_party/binutils/build.sh @@ -62,4 +62,5 @@ cd .. echo "" echo "Cleaning up binutils build temp" -#rm -rf ./binutils-$SNAPSHOT_VERSION +rm -rf ./binutils-$SNAPSHOT_VERSION +rm -rf ./binutils-$SNAPSHOT_VERSION.tar.gz diff --git a/xenia-build b/xenia-build index 1300323237..3d6044af45 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)' @@ -1268,12 +1269,24 @@ 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')