Working on Windows compatibility.
llvm-config is broken on Windows though, so that needs to be fixed. Sigh.
This commit is contained in:
parent
f117f870fb
commit
5da1fd66d1
16
README.md
16
README.md
|
@ -36,9 +36,17 @@ Windows SDK, the full DirectX SDK, and the Kinect SDK.
|
||||||
* [Windows SDK](http://www.microsoft.com/download/en/details.aspx?id=8279)
|
* [Windows SDK](http://www.microsoft.com/download/en/details.aspx?id=8279)
|
||||||
* [DirectX SDK](http://msdn.microsoft.com/en-us/directx/)
|
* [DirectX SDK](http://msdn.microsoft.com/en-us/directx/)
|
||||||
* [Kinect SDK](http://www.kinectforwindows.org/download/)
|
* [Kinect SDK](http://www.kinectforwindows.org/download/)
|
||||||
* [Doxygen](http://www.stack.nl/~dimitri/doxygen/download.html#latestsrc)
|
* [Python 2.7](http://www.python.org/download/releases/2.7.3/)
|
||||||
* [Python 2.6](http://www.python.org/getit/releases/2.6/)
|
|
||||||
* [CMake](http://www.cmake.org/cmake/resources/software.html)
|
Make sure that Python is on your PATH.
|
||||||
|
Use the Visual Studio 2010 x64 command prompt.
|
||||||
|
|
||||||
|
There's a bug in VC++ that breaks with an internal error when building LLVM.
|
||||||
|
Change line 87 of include/llvm/ADT/StringExtras.h:
|
||||||
|
```
|
||||||
|
-static inline std::string utostr(uint64_t X, bool isNeg = false) {
|
||||||
|
+static __declspec(noinline) std::string utostr(uint64_t X, bool isNeg = false) {
|
||||||
|
```
|
||||||
|
|
||||||
#### OS X
|
#### OS X
|
||||||
|
|
||||||
|
@ -83,7 +91,7 @@ Xcode to build or debug your projects you'll need to run this after you change
|
||||||
gyp/gypi files.
|
gyp/gypi files.
|
||||||
|
|
||||||
xb gyp
|
xb gyp
|
||||||
|
|
||||||
#### xethunk
|
#### xethunk
|
||||||
|
|
||||||
Updates the checked-in `src/cpu/xethunk/xethunk.bc` and `xethunk.ll` files.
|
Updates the checked-in `src/cpu/xethunk/xethunk.bc` and `xethunk.ll` files.
|
||||||
|
|
|
@ -18,6 +18,12 @@ def main():
|
||||||
# Add self to the root search path.
|
# Add self to the root search path.
|
||||||
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
|
sys.path.insert(0, os.path.abspath(os.path.dirname(__file__)))
|
||||||
|
|
||||||
|
# Augment path to include our fancy things.
|
||||||
|
os.environ['PATH'] += os.pathsep + os.pathsep.join([
|
||||||
|
os.path.abspath('third_party/ninja/'),
|
||||||
|
os.path.abspath('third_party/gyp/')
|
||||||
|
])
|
||||||
|
|
||||||
# Check python version.
|
# Check python version.
|
||||||
if sys.version_info < (2, 7):
|
if sys.version_info < (2, 7):
|
||||||
print 'ERROR: python 2.7+ required'
|
print 'ERROR: python 2.7+ required'
|
||||||
|
@ -112,9 +118,15 @@ def run_command(command, args, cwd):
|
||||||
def has_bin(bin):
|
def has_bin(bin):
|
||||||
"""Checks whether the given binary is present.
|
"""Checks whether the given binary is present.
|
||||||
"""
|
"""
|
||||||
DEVNULL = open(os.devnull, 'wb')
|
for path in os.environ["PATH"].split(os.pathsep):
|
||||||
return True if subprocess.call(
|
path = path.strip('"')
|
||||||
'which %s' % (bin), shell=True, stdout=DEVNULL) == 0 else False
|
exe_file = os.path.join(path, bin)
|
||||||
|
if os.path.isfile(exe_file) and os.access(exe_file, os.X_OK):
|
||||||
|
return True
|
||||||
|
exe_file = exe_file + '.exe'
|
||||||
|
if os.path.isfile(exe_file) and os.access(exe_file, os.X_OK):
|
||||||
|
return True
|
||||||
|
return None
|
||||||
|
|
||||||
|
|
||||||
def shell_call(command, throw_on_error=True):
|
def shell_call(command, throw_on_error=True):
|
||||||
|
@ -170,7 +182,7 @@ def post_update_deps(config):
|
||||||
config: 'debug' or 'release'.
|
config: 'debug' or 'release'.
|
||||||
"""
|
"""
|
||||||
print '- building llvm...'
|
print '- building llvm...'
|
||||||
shell_call('third_party/ninja/ninja -C build/llvm/%s-obj/ install' % (config))
|
shell_call('ninja -C build/llvm/%s-obj/ install' % (config))
|
||||||
print ''
|
print ''
|
||||||
|
|
||||||
|
|
||||||
|
@ -206,9 +218,14 @@ class SetupCommand(Command):
|
||||||
print ''
|
print ''
|
||||||
|
|
||||||
# Run the ninja bootstrap to build it, if it's missing.
|
# Run the ninja bootstrap to build it, if it's missing.
|
||||||
if not os.path.exists('third_party/ninja/ninja'):
|
if (not os.path.exists('third_party/ninja/ninja') and
|
||||||
|
not os.path.exists('third_party/ninja/ninja.exe')):
|
||||||
print '- preparing ninja...'
|
print '- preparing ninja...'
|
||||||
shell_call('python third_party/ninja/bootstrap.py')
|
# Windows needs --x64 to force building the 64-bit ninja.
|
||||||
|
extra_args = ''
|
||||||
|
if sys.platform == 'win32':
|
||||||
|
extra_args = '--x64'
|
||||||
|
shell_call('python third_party/ninja/bootstrap.py ' + extra_args)
|
||||||
print ''
|
print ''
|
||||||
|
|
||||||
# Ensure cmake is present.
|
# Ensure cmake is present.
|
||||||
|
@ -221,34 +238,43 @@ class SetupCommand(Command):
|
||||||
else:
|
else:
|
||||||
print 'ERROR: need to install cmake, use:'
|
print 'ERROR: need to install cmake, use:'
|
||||||
print 'http://www.cmake.org/cmake/resources/software.html'
|
print 'http://www.cmake.org/cmake/resources/software.html'
|
||||||
|
print 'Run the Windows installer, select the \'Add to system path\''
|
||||||
|
print 'option and restart your command prompt to ensure it\'s on the'
|
||||||
|
print 'PATH.'
|
||||||
return 1
|
return 1
|
||||||
print ''
|
print ''
|
||||||
|
|
||||||
# Binutils.
|
# Binutils.
|
||||||
# TODO(benvanik): disable on Windows
|
# TODO(benvanik): disable on Windows
|
||||||
print '- binutils...'
|
print '- binutils...'
|
||||||
if not os.path.exists('build/binutils'):
|
if sys.platform == 'win32':
|
||||||
os.makedirs('build/binutils')
|
print 'WARNING: ignoring binutils on Windows... don\'t change tests!'
|
||||||
os.chdir('build/binutils')
|
else:
|
||||||
shell_call(' '.join([
|
if not os.path.exists('build/binutils'):
|
||||||
'../../third_party/binutils/configure',
|
os.makedirs('build/binutils')
|
||||||
'--disable-debug',
|
os.chdir('build/binutils')
|
||||||
'--disable-dependency-tracking',
|
shell_call(' '.join([
|
||||||
'--disable-werror',
|
'../../third_party/binutils/configure',
|
||||||
'--enable-interwork',
|
'--disable-debug',
|
||||||
'--enable-multilib',
|
'--disable-dependency-tracking',
|
||||||
'--target=powerpc-none-elf',
|
'--disable-werror',
|
||||||
'--with-gnu-ld',
|
'--enable-interwork',
|
||||||
'--with-gnu-as',
|
'--enable-multilib',
|
||||||
]))
|
'--target=powerpc-none-elf',
|
||||||
shell_call('make')
|
'--with-gnu-ld',
|
||||||
os.chdir(cwd)
|
'--with-gnu-as',
|
||||||
|
]))
|
||||||
|
shell_call('make')
|
||||||
|
os.chdir(cwd)
|
||||||
print ''
|
print ''
|
||||||
|
|
||||||
# LLVM.
|
# LLVM.
|
||||||
print '- preparing llvm...'
|
print '- preparing llvm...'
|
||||||
#generator = 'Visual Studio 10 Win64'
|
generator = ''
|
||||||
generator = 'Ninja'
|
if False:#sys.platform == 'win32':
|
||||||
|
generator = 'Visual Studio 10 Win64'
|
||||||
|
else:
|
||||||
|
generator = 'Ninja'
|
||||||
def prepareLLVM(path, obj_path, mode):
|
def prepareLLVM(path, obj_path, mode):
|
||||||
os.chdir(cwd)
|
os.chdir(cwd)
|
||||||
if not os.path.exists(path):
|
if not os.path.exists(path):
|
||||||
|
@ -257,7 +283,6 @@ class SetupCommand(Command):
|
||||||
os.makedirs(obj_path)
|
os.makedirs(obj_path)
|
||||||
os.chdir(obj_path)
|
os.chdir(obj_path)
|
||||||
shell_call(' '.join([
|
shell_call(' '.join([
|
||||||
'PATH=$PATH:../../../third_party/ninja/',
|
|
||||||
'cmake',
|
'cmake',
|
||||||
'-G"%s"' % (generator),
|
'-G"%s"' % (generator),
|
||||||
'-DCMAKE_INSTALL_PREFIX:STRING=../../../%s' % (path),
|
'-DCMAKE_INSTALL_PREFIX:STRING=../../../%s' % (path),
|
||||||
|
@ -322,7 +347,7 @@ def run_gyp(format):
|
||||||
format: gyp -f value.
|
format: gyp -f value.
|
||||||
"""
|
"""
|
||||||
shell_call(' '.join([
|
shell_call(' '.join([
|
||||||
'third_party/gyp/gyp',
|
'gyp',
|
||||||
'-f %s' % (format),
|
'-f %s' % (format),
|
||||||
# Set the VS version.
|
# Set the VS version.
|
||||||
# TODO(benvanik): allow user to set?
|
# TODO(benvanik): allow user to set?
|
||||||
|
@ -392,7 +417,7 @@ class BuildCommand(Command):
|
||||||
print ''
|
print ''
|
||||||
|
|
||||||
print '- building xenia in %s...' % (config)
|
print '- building xenia in %s...' % (config)
|
||||||
result = shell_call('third_party/ninja/ninja -C build/xenia/%s' % (config),
|
result = shell_call('ninja -C build/xenia/%s' % (config),
|
||||||
throw_on_error=False)
|
throw_on_error=False)
|
||||||
print ''
|
print ''
|
||||||
if result != 0:
|
if result != 0:
|
||||||
|
|
Loading…
Reference in New Issue