diff options
Diffstat (limited to 'WebKitTools/wx/build/build_utils.py')
-rw-r--r-- | WebKitTools/wx/build/build_utils.py | 21 |
1 files changed, 17 insertions, 4 deletions
diff --git a/WebKitTools/wx/build/build_utils.py b/WebKitTools/wx/build/build_utils.py index f6daf3a..0a795a8 100644 --- a/WebKitTools/wx/build/build_utils.py +++ b/WebKitTools/wx/build/build_utils.py @@ -23,8 +23,11 @@ # # Helper functions for the WebKit build. +import commands import glob import os +import platform +import shutil import sys import urllib import urlparse @@ -35,8 +38,11 @@ def get_output(command): """ Windows-compatible function for getting output from a command. """ - f = os.popen(command) - return f.read().strip() + if sys.platform.startswith('win'): + f = os.popen(command) + return f.read().strip() + else: + return commands.getoutput(command) def get_excludes(root, patterns): """ @@ -100,7 +106,7 @@ def download_if_newer(url, destdir): return None -def update_wx_deps(wk_root, msvc_version='msvc2008'): +def update_wx_deps(conf, wk_root, msvc_version='msvc2008'): """ Download and update tools needed to build the wx port. """ @@ -114,7 +120,10 @@ def update_wx_deps(wk_root, msvc_version='msvc2008'): sys.exit(1) # since this module is still experimental - #swig_module = download_if_newer('http://wxwebkit.wxcommunity.com/downloads/deps/swig.py', os.path.join(wk_root, 'WebKit', 'wx', 'bindings', 'python')) + wxpy_dir = os.path.join(wk_root, 'WebKit', 'wx', 'bindings', 'python') + swig_module = download_if_newer('http://wxwebkit.wxcommunity.com/downloads/deps/swig.py.txt', wxpy_dir) + if swig_module: + shutil.copy(os.path.join(wxpy_dir, 'swig.py.txt'), os.path.join(wxpy_dir, 'swig.py')) if sys.platform.startswith('win'): Logs.info('downloading deps package') @@ -123,6 +132,10 @@ def update_wx_deps(wk_root, msvc_version='msvc2008'): os.system('unzip -o %s -d %s' % (archive, os.path.join(wklibs_dir, msvc_version))) elif sys.platform.startswith('darwin'): + # export the right compiler for building the dependencies + if platform.release().startswith('10'): # Snow Leopard + os.environ['CC'] = conf.env['CC'][0] + os.environ['CXX'] = conf.env['CXX'][0] os.system('%s/WebKitTools/wx/install-unix-extras' % wk_root) def includeDirsForSources(sources): |