waf build fixes for Windows/MSVC and Mac/Snow Leopard.
authorkevino@webkit.org <kevino@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Sep 2009 18:28:30 +0000 (18:28 +0000)
committerkevino@webkit.org <kevino@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 2 Sep 2009 18:28:30 +0000 (18:28 +0000)
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@47983 268f45cc-cd09-0410-ab3c-d52691b4dbfc

JavaScriptCore/ChangeLog
JavaScriptCore/wscript
WebCore/ChangeLog
WebCore/wscript
WebKit/wx/ChangeLog
WebKit/wx/bindings/python/wscript
WebKit/wx/wscript
WebKitTools/ChangeLog
WebKitTools/wx/browser/wscript
WebKitTools/wx/build/build_utils.py
WebKitTools/wx/build/settings.py

index 6a45b0905237b1fd431f8f619490ad0e1571fa1b..1907bbc59315746c7a41964477a1b6fe58ea8039 100644 (file)
@@ -1,3 +1,9 @@
+2009-09-02  Kevin Ollivier  <kevino@theolliviers.com>
+
+        waf build fixes for Windows/MSVC.
+
+        * wscript:
+
 2009-09-02  Kevin Ollivier  <kevino@theolliviers.com>
 
         Build fix for building on Windows.
index df11430271a7d83655a01302bb9c6d25bcca693a..134b935a81bd83518c0da92568c9d2a9a568c64b 100644 (file)
@@ -37,8 +37,8 @@ sources = []
 jscore_excludes.extend(get_excludes(jscore_dir, ['*Win.cpp', '*None.cpp']))
 
 if building_on_win32:
-    jscore_excludes.append('ExecutableAllocatorPosix.cpp')
-    sources.append('jit/ExecutableAllocatorWin.cpp')
+    jscore_excludes += ['ExecutableAllocatorPosix.cpp', 'MarkStackPosix.cpp']
+    sources += ['jit/ExecutableAllocatorWin.cpp', 'runtime/MarkStackWin.cpp']
 else:
     jscore_excludes.append('JSStringRefBSTR.cpp')
 
@@ -71,8 +71,6 @@ def build(bld):
 
     full_dirs = get_dirs_for_features(jscore_dir, features=[build_port], dirs=jscore_dirs)
 
-    print 'full_dirs = %r' % full_dirs
-
     includes = common_includes + full_dirs
 
     # 1. A simple program
@@ -81,7 +79,7 @@ def build(bld):
         includes = '. .. assembler wrec DerivedSources ForwardingHeaders ' + ' '.join(includes),
         source = sources,
         target = 'jscore',
-        uselib = 'WX ICU ' + waf_configname,
+        uselib = 'WX ICU ' + get_config(),
         uselib_local = '',
         install_path = output_dir)
 
@@ -92,7 +90,7 @@ def build(bld):
         includes = '. .. assembler wrec DerivedSources ForwardingHeaders ' + ' '.join(includes),
         source = 'jsc.cpp',
         target = 'jsc',
-        uselib = 'WX ICU ' + waf_configname,
+        uselib = 'WX ICU ' + get_config(),
         uselib_local = 'jscore',
         install_path = output_dir,
         )
index 3cf7753883e778b0811ad19c130f1fb85ea58cf8..3ecbc324435d6f48c2b0ea8f7dd0f67094ce6ffd 100644 (file)
@@ -1,3 +1,9 @@
+2009-09-02  Kevin Ollivier  <kevino@theolliviers.com>
+
+        waf build fixes for Windows/MSVC.
+
+        * wscript:
+
 2009-09-02  Ben Murdoch  <benm@google.com>
 
         Unreviewed build fix for Chromium.
index eeb0802c977205e51cabe2be7bba0c6fa16d6a27..bebb02cb1af304c2c0a3e1a8c6b4c86dcd83f372 100644 (file)
@@ -117,7 +117,7 @@ def build(bld):
         source = ' '.join(flattenSources(webcore_sources.values())),
         cxxflags = cxxflags,
         target = 'webcore',
-        uselib = 'WX ICU XML XSLT CURL ' + waf_configname,
+        uselib = 'WX ICU XML XSLT CURL ' + get_config(),
         uselib_local = '',
         install_path = output_dir,
         )
@@ -127,6 +127,11 @@ def build(bld):
         excludes = get_excludes(webcore_dir, ['*None.cpp', '*CF.cpp', '*Qt.cpp', '*Win.cpp', '*Wince.cpp', '*Gtk.cpp', '*Mac.cpp', '*Safari.cpp', '*Chromium*.cpp','*SVG*.cpp', '*AllInOne.cpp', 'test*bindings.*'])
         excludes.extend(['UserStyleSheetLoader.cpp', 'RenderMediaControls.cpp'])
 
+
+        # FIXME: undo this once these classes are fully implemented
+        excludes.append('SocketStreamErrorBase.cpp')
+        excludes.append('SocketStreamHandleBase.cpp')
+
         # intermediate sources
         excludes.append('CSSValueKeywords.c')
         excludes.append('CSSPropertyNames.cpp')
index d26728977668d299e5c09dbc57927551d36d2082..e55b068afab0a2b621f7442670357e27801a6a15 100644 (file)
@@ -1,3 +1,10 @@
+2009-09-02  Kevin Ollivier  <kevino@theolliviers.com>
+
+        waf build fixes for Windows/MSVC.
+
+        * bindings/python/wscript:
+        * wscript:
+
 2009-09-02  Kevin Watters  <kevinwatters@gmail.com>
 
         Reviewed by Kevin Ollivier.
index 904e68ebb081671a21f7c063644be23e91b9aa36..56017c8fa789aced6610e84faff30448f206d51c 100644 (file)
@@ -55,9 +55,10 @@ def set_options(opt):
     common_set_options(opt)
 
 def configure(conf):
-    common_configure(conf)
-    conf.check_tool('swig', tooldir='.')
-    conf.check_swig_version('1.3.29')
+    if Options.options.wxpython:
+        common_configure(conf)
+        conf.check_tool('swig', tooldir='.')
+        conf.check_swig_version('1.3.29')
     
 def build(bld):
     if Options.options.wxpython:
@@ -87,7 +88,7 @@ def build(bld):
             swig_flags = ' '.join(wx_swig_args),
             defines = defines,
             target = '_webview',
-            uselib = 'WX CURL ICU XSLT XML SQLITE3 WXWEBKIT ' + waf_configname,
+            uselib = 'WX CURL ICU XSLT XML SQLITE3 WXWEBKIT ' + get_config(),
             
             libpath = [output_dir],
             uselib_local = '',
index d8f3c33b66eb3988f70e75703547b496211f0f70..b61e9480b5fb39d374443ae3f618383d551bbd43 100644 (file)
@@ -40,6 +40,13 @@ include_paths = webkit_dirs + common_includes + ['.', '..',
                 os.path.join(wk_root, 'WebCore', 'platform', 'graphics', 'wx'),
 ]
 
+windows_deps = [
+                'lib/pthreadVC2.dll',
+                'bin/icuuc40.dll', 'bin/icudt40.dll', 'bin/icuin40.dll',
+                'bin/libcurl.dll', 'bin/libeay32.dll', 'bin/ssleay32.dll', 'bin/zlib1.dll',
+                'lib/sqlite3.dll', 'bin/libxml2.dll', 'bin/libxslt.dll', 'bin/iconv.dll',
+                ]
+
 webcore_include_dirs = []
 for dir in webcore_dirs + ['DerivedSources']:
     include_paths.append(os.path.join(wk_root, 'WebCore', dir)) 
@@ -59,8 +66,13 @@ def pre_build(bld):
     The wxWebKit library should be rebuilt if jscore or webcore changes,
     so we make those static libs as dependencies.
     """
-    libjscore = os.path.join(output_dir, 'libjscore.a')
-    libwebcore = os.path.join(output_dir, 'libwebcore.a')
+    
+    ext = '.a'
+    if sys.platform.startswith('win'):
+        ext = '.lib'
+    
+    libjscore = os.path.join(output_dir, 'libjscore%s' % ext)
+    libwebcore = os.path.join(output_dir, 'libwebcore%s' % ext)
     
     assert os.path.exists(libjscore)
     assert os.path.exists(libwebcore)
@@ -76,9 +88,18 @@ def build(bld):
         includes = ' '.join(include_paths + js_include_dirs),
         target = 'wxwebkit',
         defines = ['WXMAKINGDLL_WEBKIT'],
-        uselib = 'WX CURL ICU XSLT XML SQLITE3 WEBCORE JSCORE ' + waf_configname,
+        uselib = 'WX CURL ICU XSLT XML SQLITE3 WEBCORE JSCORE ' + get_config(),
         libpath = [output_dir],
         uselib_local = '',
         install_path = output_dir)
         
     obj.find_sources_in_dirs(webkit_dirs)
+
+    if building_on_win32:
+        for wxlib in bld.env['LIB_WX']:
+            wxlibname = os.path.join(bld.env['LIBPATH_WX'][0], wxlib + '_vc.dll')
+            if os.path.exists(wxlibname):
+                bld.install_files(obj.install_path, [wxlibname])
+        
+        for dep in windows_deps:
+            bld.install_files(obj.install_path, [os.path.join(msvclibs_dir, dep)])
index f397155c4dcc544557569beabcd7b27553a5fc54..d1d8dc1ddce7595059b5b42d5b62746cf3469d64 100644 (file)
@@ -1,3 +1,11 @@
+2009-09-02  Kevin Ollivier  <kevino@theolliviers.com>
+
+        waf build fixes for Windows/MSVC and Mac/Snow Leopard.
+
+        * wx/browser/wscript:
+        * wx/build/build_utils.py:
+        * wx/build/settings.py:
+
 2009-08-10  Kevin Ollivier  <kevino@theolliviers.com>
 
         Reviewed by Eric Seidel.
index fb8d81fccdf9bc8555de63605ae38c01077630a4..a2a24e05778251a1f18e88508402267dd3b1a8fb 100644 (file)
@@ -45,7 +45,7 @@ def build(bld):
         includes = ' '.join(include_paths),
         source = 'browser.cpp',
         target = 'wxBrowser',
-        uselib = 'WX CURL ICU XSLT XML WXWEBKIT ' + waf_configname,
+        uselib = 'WX CURL ICU XSLT XML WXWEBKIT ' + get_config(),
         libpath = [output_dir],
         uselib_local = '',
         install_path = output_dir)
index f6daf3a52e134bdd6af7e137489f1234def945b7..ec5c52e1ae4d3c1272fc630b9283a7e9dd29aee2 100644 (file)
@@ -23,6 +23,7 @@
 #
 # Helper functions for the WebKit build.
 
+import commands
 import glob
 import os
 import sys
@@ -35,8 +36,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):
     """
index 1da9faa1fbae2c5f2bbc7c2ed641a756d15d0732..cacfc9618eeb247d77bb8afafc56655281575cfa 100644 (file)
 import commands
 import os
 import platform
+import re
 import sys
 
+import Options
+
 from build_utils import *
 from waf_extensions import *
 
@@ -122,18 +125,33 @@ config = 'Debug'
 if os.path.exists(config_file):
     config = open(config_file).read()
 
-output_dir = os.path.join(wk_root, 'WebKitBuild', config)
+try:
+    branches = commands.getoutput("git branch --no-color")
+    match = re.search('^\* (.*)', branches, re.MULTILINE)
+    if match:
+        config += ".%s" % match.group(1)
+except:
+    pass
 
-waf_configname = config.upper()
+output_dir = os.path.join(wk_root, 'WebKitBuild', config)
 
 build_port = "wx"
 building_on_win32 = sys.platform.startswith('win')
 
-if building_on_win32:
-    if config == 'Release':
-        waf_configname = waf_configname + ' CRT_MULTITHREADED_DLL'
-    else:
-        waf_configname = waf_configname + ' CRT_MULTITHREADED_DLL_DBG'
+def get_config():
+    waf_configname = config.upper().strip()
+    if building_on_win32:
+        isReleaseCRT = (config == 'Release')
+        if build_port == 'wx':
+            if Options.options.wxpython:
+                isReleaseCRT = True
+        
+        if isReleaseCRT:
+            waf_configname = waf_configname + ' CRT_MULTITHREADED_DLL'
+        else:
+            waf_configname = waf_configname + ' CRT_MULTITHREADED_DLL_DBG'
+            
+    return waf_configname
 
 create_hash_table = wk_root + "/JavaScriptCore/create_hash_table"
 if building_on_win32:
@@ -142,6 +160,16 @@ os.environ['CREATE_HASH_TABLE'] = create_hash_table
 
 feature_defines = ['ENABLE_DATABASE', 'ENABLE_XSLT', 'ENABLE_JAVASCRIPT_DEBUGGER']
 
+msvc_version = 'msvc2008'
+
+msvclibs_dir = os.path.join(wklibs_dir, msvc_version, 'win')
+
+def get_path_to_wxconfig():
+    if 'WX_CONFIG' in os.environ:
+        return os.environ['WX_CONFIG']
+    else:
+        return 'wx-config'
+
 def common_set_options(opt):
     """
     Initialize common options provided to the user.
@@ -156,6 +184,15 @@ def common_configure(conf):
     """
     Configuration used by all targets, called from the target's configure() step.
     """
+    
+    if sys.platform.startswith('darwin') and build_port == 'wx':
+        import platform
+        if platform.release().startswith('10'): # Snow Leopard
+            config = commands.getoutput('%s --selected-config' % get_path_to_wxconfig())
+            if config.find('osx_cocoa') == -1:
+                # wx/Carbon only supports 32-bit compilation, so we want gcc-4.0 instead of 4.2 on Snow Leopard
+                conf.env['CC'] = 'gcc-4.0'
+                conf.env['CXX'] = 'g++-4.0'
     conf.check_tool('compiler_cxx')
     conf.check_tool('compiler_cc')
     conf.check_tool('python')
@@ -164,18 +201,20 @@ def common_configure(conf):
     if sys.platform.startswith('darwin'):
         conf.check_tool('osx')
     
-    msvc_version = 'msvc2008'
+    global msvc_version
+    global msvclibs_dir
+    
     if building_on_win32:
         found_versions = conf.get_msvc_versions()
         if found_versions[0][0] == 'msvc 9.0':
             msvc_version = 'msvc2008'
         elif found_versions[0][0] == 'msvc 8.0':
             msvc_version = 'msvc2005'
-       
-    msvclibs_dir = ''
+        
+        msvclibs_dir = os.path.join(wklibs_dir, msvc_version, 'win')
+    
     if build_port == "wx":
         update_wx_deps(wk_root, msvc_version)
-        msvclibs_dir = os.path.join(wklibs_dir, msvc_version, 'win')
     
         conf.env.append_value('CXXDEFINES', ['BUILDING_WX__=1', 'WTF_USE_WXGC=1'])
 
@@ -195,6 +234,14 @@ def common_configure(conf):
     
         conf.env.append_value('CPPPATH', wklibs_dir)
         conf.env.append_value('LIBPATH', wklibs_dir)
+        
+        # WebKit only supports 10.4+
+        mac_target = 'MACOSX_DEPLOYMENT_TARGET'
+        if mac_target in os.environ and os.environ[mac_target] == '10.3':
+            os.environ[mac_target] = '10.4'
+        
+        if mac_target in conf.env and conf.env[mac_target] == '10.3':
+            conf.env[mac_target] = '10.4'
     
     #conf.env['PREFIX'] = output_dir
     
@@ -247,7 +294,7 @@ def common_configure(conf):
             conf.env.append_value('CPPPATH', os.path.join(wklibs_dir, 'unix', 'include'))
             conf.env.append_value('CXXFLAGS', ['-fPIC', '-DPIC'])
             
-            conf.check_cfg(path='wx-config', args='--cxxflags --libs', package='', uselib_store='WX')
+            conf.check_cfg(path=get_path_to_wxconfig(), args='--cxxflags --libs', package='', uselib_store='WX')
             
         conf.check_cfg(path='xslt-config', args='--cflags --libs', package='', uselib_store='XSLT')
         conf.check_cfg(path='xml2-config', args='--cflags --libs', package='', uselib_store='XML')