Web Inspector: reuse edge_count field of heap snapshot to store retained size
[WebKit-https.git] / wscript
diff --git a/wscript b/wscript
index 8f6c227..a667613 100644 (file)
--- a/wscript
+++ b/wscript
 #
 # WebCore build script for the waf build system
 
+import glob
+import os
+import subprocess
+
 import Options
 
 from settings import *
+import wxpresets
 
-if build_port == "wx":
-    webcore_dirs.extend(['Source/WebKit/wx', 'Source/WebKit/wx/WebKitSupport'])
-
-wk_includes = ['.',
-                os.path.join(wk_root, 'Source', 'JavaScriptCore'),
-                os.path.join(wk_root, 'Source', 'JavaScriptCore', 'wtf', 'text'),
-                os.path.join(wk_root, 'Source', 'WebCore'),
-                os.path.join(wk_root, 'Source', 'WebCore', 'DerivedSources'),
-                os.path.join(wk_root, 'Source', 'WebCore', 'platform', 'image-decoders'),
-                os.path.join(wk_root, 'Source', 'WebCore', 'platform', 'win'),
-                os.path.join(wk_root, 'Source', 'WebCore', 'workers'),
-                os.path.join(output_dir),
-        ]
-
-if build_port == "wx":
-    wk_includes.append(os.path.join(wk_root, 'Source', 'WebKit', 'wx'))
-    wk_includes.append(os.path.join(wk_root, 'Source', 'WebCore', 'platform', 'wx', 'wxcode'))
-
-if sys.platform.startswith("win"):
-    wk_includes.append(os.path.join(wk_root, 'Source', 'WebCore', 'platform', 'win'))
-    wk_includes.append(os.path.join(wk_root, 'Source', 'WebCore', 'platform', 'graphics', 'win'))
-
-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_sources = {}
-
-if build_port == "wx":
-    webcore_sources['wx'] = [
-        'Source/WebCore/bindings/cpp/WebDOMEventTarget.cpp',
-        'Source/WebCore/platform/KillRingNone.cpp',                     
-        'Source/WebCore/platform/text/LocalizedNumberNone.cpp'
-    ]  
-
-    if building_on_win32:
-        # make sure platform/wx comes after this so we get the right
-        # FontPlatformData.h
-        webcore_dirs.extend(['Source/WebCore/platform/wx/wxcode/win', 'Source/WebCore/plugins/win'])
-        webcore_sources['wx-win'] = [
-               'Source/WebCore/platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp',
-               'Source/WebCore/platform/graphics/win/TransformationMatrixWin.cpp',
-               'Source/WebCore/platform/ScrollAnimatorWin.cpp',
-               # wxTimer on Windows has a bug that causes it to eat crashes in callbacks
-               # so we need to use the Win port's implementation until the wx bug fix is
-               # widely available (it was fixed in 2.8.10).
-               'Source/WebCore/platform/win/SharedTimerWin.cpp',
-               'Source/WebCore/platform/win/WebCoreInstanceHandle.cpp',
-               # Use the Windows plugin architecture
-               #'Source/WebCore/plugins/win/PluginDataWin.cpp',
-               'Source/WebCore/plugins/win/PluginDatabaseWin.cpp',
-               'Source/WebCore/plugins/win/PluginMessageThrottlerWin.cpp',
-               'Source/WebCore/plugins/win/PluginPackageWin.cpp',
-               'Source/WebCore/plugins/win/PluginViewWin.cpp',
-        ]
-    elif sys.platform.startswith('darwin'):
-        webcore_dirs.append('Source/WebCore/plugins/mac')
-        webcore_dirs.append('Source/WebCore/platform/wx/wxcode/mac/carbon')
-        webcore_dirs.append('Source/WebCore/platform/mac')
-        webcore_dirs.append('Source/WebCore/platform/text/mac')
-        webcore_sources['wx-mac'] = [
-               'Source/WebCore/platform/mac/PurgeableBufferMac.cpp',
-               'Source/WebCore/platform/mac/WebCoreNSStringExtras.mm',
-               'Source/WebCore/platform/mac/WebCoreSystemInterface.mm',
-               'Source/WebCore/platform/graphics/cg/FloatSizeCG.cpp',
-               'Source/WebCore/platform/graphics/mac/ComplexTextController.cpp',
-               'Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.cpp',
-               'Source/WebCore/platform/graphics/mac/ComplexTextControllerATSUI.cpp',
-               'Source/WebCore/platform/graphics/mac/GlyphPageTreeNodeMac.cpp',
-               'Source/WebCore/platform/graphics/mac/SimpleFontDataATSUI.mm',
-               'Source/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp',
-               'Source/WebCore/platform/graphics/wx/FontPlatformDataWxMac.mm',
-               'Source/WebCore/platform/text/mac/ShapeArabic.c',
-               'Source/WebCore/platform/wx/wxcode/mac/carbon/fontprops.mm',
-               'Source/WebCore/plugins/mac/PluginPackageMac.cpp',
-               'Source/WebCore/plugins/mac/PluginViewMac.mm'
-        ]
-    else:
-        webcore_sources['wx-gtk'] = [
-               'Source/WebCore/plugins/PluginViewNone.cpp',
-               'Source/WebCore/plugins/PluginPackageNone.cpp'
-        ]
-        webcore_dirs.append('Source/WebCore/platform/wx/wxcode/gtk')
-        
 import TaskGen
 from TaskGen import taskgen, feature, after
 import Task, ccroot
 
-def generate_webcore_derived_sources():
+def clean_derived_sources(ds_cmd):
+    # the below command does not produce the desired output under Cygwin, so for now,
+    # disable this under Windows.
+    if building_on_win32:
+        return
+        
+    cmd = ds_cmd + " -qp | grep -v '^# ' | grep -v '^[[:space:]]' | grep --only-matching '^.*:'"
+    output = subprocess.check_output(cmd, shell=True)
+    
+    targets = []
+    lines = output.split("\n")
+    for line in lines:
+        line = line.replace(":", "")
+        base = os.path.splitext(os.path.basename(line))[0]
+        if not base in targets:
+            targets.append(base)
+            if base == "UserAgentsStyleSheet":
+                targets.append("UserAgentsStyleSheetData")
+    
+    # we're in the DerivedSources directory when this command is run.
+    ds_files = glob.glob("*.*")
+    for ds_file in ds_files:
+        filename = os.path.basename(ds_file)
+        basename = os.path.splitext(filename)[0]
+        # For now, just remove JS*.h/.cpp and WebDOM*.h/.cpp when there are no longer targets
+        # for them. Other targets may generate supplemental files so we can't reliably clean them.
+        if not basename in targets and (basename.startswith("JS") or basename.startswith("WebDOM")):
+            print "INFO: %s is no longer generated but present in generated files directory. Removing." % filename
+            os.remove(ds_file)
+    
+def generate_webcore_derived_sources(conf):
     # build the derived sources
     derived_sources_dir = os.path.join(webcore_dir, 'DerivedSources')
     wc_dir = webcore_dir
@@ -136,12 +84,15 @@ def generate_webcore_derived_sources():
     if building_on_win32:
         oldpath = os.environ["PATH"]
         os.environ["PATH"] = "/usr/bin" + os.pathsep + os.environ["PATH"]
-    os.system('make -f %s/DerivedSources.make WebCore=%s SOURCE_ROOT=%s all FEATURE_DEFINES="%s"' % (wc_dir, wc_dir, wc_dir, ' '.join(feature_defines)))
+    command = 'make -f %s/DerivedSources.make WebCore=%s SOURCE_ROOT=%s all FEATURE_DEFINES="%s"' % (wc_dir, wc_dir, wc_dir, conf.env["FEATURE_DEFINES"])
+    clean_derived_sources(command)
+    os.system(command)
     if building_on_win32:
         os.environ["PATH"] = oldpath
+    
     os.chdir(olddir)
 
-def generate_jscore_derived_sources():
+def generate_jscore_derived_sources(conf):
     # build the derived sources
     js_dir = jscore_dir
     if building_on_win32:
@@ -157,7 +108,7 @@ def generate_jscore_derived_sources():
     if building_on_win32:
         oldpath = os.environ["PATH"]
         os.environ["PATH"] = "/usr/bin" + os.pathsep + os.environ["PATH"]
-    command = 'make -f %s/DerivedSources.make JavaScriptCore=%s BUILT_PRODUCTS_DIR=%s all FEATURE_DEFINES="%s"' % (js_dir, js_dir, js_dir, ' '.join(feature_defines))
+    command = 'make -f %s/DerivedSources.make JavaScriptCore=%s BUILT_PRODUCTS_DIR=%s all FEATURE_DEFINES="%s"' % (js_dir, js_dir, js_dir, conf.env["FEATURE_DEFINES"])
     os.system(command)
     if building_on_win32:
         os.environ["PATH"] = oldpath
@@ -168,15 +119,17 @@ def set_options(opt):
 
 def configure(conf):
     common_configure(conf)
-    generate_jscore_derived_sources()
-    generate_webcore_derived_sources()
-    if build_port == "wx" and sys.platform.startswith('win'):
+    generate_jscore_derived_sources(conf)
+    generate_webcore_derived_sources(conf)
+    if Options.options.port == "wx" and sys.platform.startswith('win'):
         graphics_dir = os.path.join(wk_root, 'Source', 'WebCore', 'platform', 'graphics')
-        # HACK ALERT: MSVC automatically adds the source file's directory as the first entry in the
-        # path. Unfortunately, that means when compiling these files we will end up including
-        # win/FontPlatformData.h, which breaks wx compilation. So we copy the files to the wx dir.
+        # we used to copy these files into the graphics/wx directory due to 
+        # both wx and win directories having FontPlatformData.h. That is no 
+        # longer the case, so we remove the old files if they exist.
         for afile in ['UniscribeController.h', 'UniscribeController.cpp', 'GlyphPageTreeNodeCairoWin.cpp']:
-            shutil.copy(os.path.join(graphics_dir, 'win', afile), os.path.join(graphics_dir, 'wx'))
+            wx_copy = os.path.join(graphics_dir, 'wx', afile)
+            if os.path.exists(wx_copy):
+                os.remove(wx_copy)
 
     webcore_out_dir = os.path.join(output_dir, 'WebCore')
     if not os.path.exists(webcore_out_dir):
@@ -188,38 +141,150 @@ def configure(conf):
     for api_file in glob.glob(os.path.join(jscore_dir, 'API/*.h')):
         shutil.copy(api_file, os.path.join(jscore_out_dir, os.path.basename(api_file)))
 
-    if build_port == "wx" and Options.options.wxpython:
+    if Options.options.port == "wx" and Options.options.wxpython:
         common_configure(conf)
         conf.check_tool('swig', tooldir='Source/WebKit/wx/bindings/python')
         conf.check_swig_version('1.3.29')
 
-def build(bld):  
+def build(bld):
+
+    webcore_dirs = list(webcore_dirs_common)
+
+    # auto-generate WebKitVersion.h if needed before we start the build.
+    # Also, remove the file from the old location where we generated it before running
+    wk_version_h = 'Source/WebCore/DerivedSources/WebKitVersion.h'
+    if os.path.exists(wk_version_h):
+        os.remove(wk_version_h)
+    bld.new_task_gen(source = "Source/WebKit/mac/Configurations/Version.xcconfig",
+                     target = wk_version_h,
+                     rule = 'perl %s/Source/WebKit/scripts/generate-webkitversion.pl --outputDir=${TGT[0].dir(env)} --config ${SRC}' % wk_root)
+    bld.add_group()
+
+    if Options.options.port == "wx":
+        webcore_dirs.extend(['Source/WebKit/wx', 'Source/WebKit/wx/WebKitSupport'])
+    
+    wk_includes = ['.',
+                    os.path.join(wk_root, 'Source', 'WTF'),
+                    os.path.join(wk_root, 'Source', 'WTF', 'wtf'),
+                    os.path.join(wk_root, 'Source', 'JavaScriptCore'),
+                    os.path.join(wk_root, 'Source', 'WebCore'),
+                    os.path.join(wk_root, 'Source', 'WebCore', 'DerivedSources'),
+                    os.path.join(wk_root, 'Source', 'WebCore', 'platform', 'image-decoders'),
+                    os.path.join(wk_root, 'Source', 'WebCore', 'platform', 'win'),
+                    os.path.join(wk_root, 'Source', 'WebCore', 'workers'),
+                    os.path.join(output_dir),
+            ]
+    
+    if Options.options.port == "wx":
+        wk_includes.append(os.path.join(wk_root, 'Source', 'WebKit', 'wx'))
+        wk_includes.append(os.path.join(wk_root, 'Source', 'WebCore', 'platform', 'wx', 'wxcode'))
+    
+    if sys.platform.startswith("win"):
+        wk_includes.append(os.path.join(wk_root, 'Source', 'WebCore', 'platform', 'win'))
+        wk_includes.append(os.path.join(wk_root, 'Source', 'WebCore', 'platform', 'graphics', 'win'))
+    
+    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_sources = {}
+    
+    if Options.options.port == "wx":
+        webcore_sources['wx'] = [
+            'Source/WebCore/bindings/cpp/WebDOMEventTarget.cpp',
+            'Source/WebCore/platform/KillRingNone.cpp',
+            'Source/WebCore/platform/text/LocalizedDateNone.cpp',
+            'Source/WebCore/platform/text/LocalizedNumberNone.cpp',
+            'Source/WebCore/page/scrolling/ScrollingCoordinatorNone.cpp',
+        ]  
+    
+        if building_on_win32:
+            # make sure platform/wx comes after this so we get the right
+            # FontPlatformData.h
+            webcore_dirs.extend(['Source/WebCore/platform/wx/wxcode/win', 'Source/WebCore/plugins/win'])
+            webcore_sources['wx-win'] = [
+                   'Source/WebCore/platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp',
+                   'Source/WebCore/platform/graphics/win/TransformationMatrixWin.cpp',
+                   'Source/WebCore/platform/graphics/win/UniscribeController.cpp',
+                   'Source/WebCore/platform/ScrollAnimatorNone.cpp',
+                   # wxTimer on Windows has a bug that causes it to eat crashes in callbacks
+                   # so we need to use the Win port's implementation until the wx bug fix is
+                   # widely available (it was fixed in 2.8.10).
+                   'Source/WebCore/platform/win/SharedTimerWin.cpp',
+                   'Source/WebCore/platform/win/SystemInfo.cpp',
+                   'Source/WebCore/platform/win/WebCoreInstanceHandle.cpp',
+                   # Use the Windows plugin architecture
+                   #'Source/WebCore/plugins/win/PluginDataWin.cpp',
+                   'Source/WebCore/plugins/win/PluginDatabaseWin.cpp',
+                   'Source/WebCore/plugins/win/PluginMessageThrottlerWin.cpp',
+                   'Source/WebCore/plugins/win/PluginPackageWin.cpp',
+                   'Source/WebCore/plugins/win/PluginViewWin.cpp',
+            ]
+            if Options.options.cairo:
+                webcore_dirs.append('Source/WebCore/platform/wx/wxcode/cairo')
+            else:
+                webcore_dirs.append('Source/WebCore/platform/wx/wxcode/gdiplus')
+        elif sys.platform.startswith('darwin'):
+            webcore_dirs.append('Source/WebCore/plugins/mac')
+            webcore_dirs.append('Source/WebCore/platform/wx/wxcode/mac/carbon')
+            webcore_dirs.append('Source/WebCore/platform/text/mac')
+            webcore_sources['wx-mac'] = [
+                   'Source/WebCore/platform/mac/PurgeableBufferMac.cpp',
+                   'Source/WebCore/platform/mac/WebCoreNSStringExtras.mm',
+                   'Source/WebCore/platform/mac/WebCoreSystemInterface.mm',
+                   'Source/WebCore/platform/graphics/cg/FloatSizeCG.cpp',
+                   'Source/WebCore/platform/graphics/mac/ComplexTextController.cpp',
+                   'Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm',
+                   'Source/WebCore/platform/graphics/mac/ComplexTextControllerATSUI.cpp',
+                   'Source/WebCore/platform/graphics/mac/GlyphPageTreeNodeMac.cpp',
+                   'Source/WebCore/platform/graphics/mac/SimpleFontDataATSUI.mm',
+                   'Source/WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp',
+                   'Source/WebCore/platform/graphics/wx/FontPlatformDataWxMac.mm',
+                   'Source/WebCore/platform/wx/wxcode/mac/carbon/fontprops.mm',
+                   'Source/WebCore/plugins/mac/PluginPackageMac.cpp',
+                   'Source/WebCore/plugins/mac/PluginViewMac.mm'
+            ]
+        else:
+            webcore_sources['wx-gtk'] = [
+                   'Source/WebCore/plugins/PluginViewNone.cpp',
+                   'Source/WebCore/plugins/PluginPackageNone.cpp'
+            ]
+            webcore_dirs.append('Source/WebCore/platform/wx/wxcode/gtk')
+            webcore_dirs.append('Source/WebCore/platform/wx/wxcode/cairo')
+        
+
     import TaskGen
-    global wk_includes
 
-    # FIXME: Does this need to be Source/JavaScriptCore?
     bld.add_subdirs('Source/JavaScriptCore')
 
     if sys.platform.startswith('darwin'):
         TaskGen.task_gen.mappings['.mm'] = TaskGen.task_gen.mappings['.cxx']
         TaskGen.task_gen.mappings['.m'] = TaskGen.task_gen.mappings['.cxx']
 
-    features = [build_port]
-    exclude_patterns = ['*AllInOne.cpp', '*Brew.cpp', '*CFNet.cpp', '*Chromium*.cpp', 
-            '*Efl.cpp', '*Gtk.cpp', '*Haiku.cpp', '*Mac.cpp', '*None.cpp', '*Qt.cpp', '*Safari.cpp',
-            'test*bindings.*', '*WinCE.cpp', "WebDOMCanvas*.cpp", "WebDOMSVG*.cpp"]
-    if build_port == 'wx':
-        features.append('curl')
-        exclude_patterns.append('*Win.cpp')
-        
+    features = [Options.options.port.lower()]
+    thisport = Options.options.port
+    
+    exclude_patterns = ['*AllInOne.cpp', '*None.cpp',]
+
     if sys.platform.startswith('darwin'):
         features.append('cf')
-        
-    else:
-        exclude_patterns.append('*CF.cpp')
 
+    # exclude the filename patterns for all other ports.
+    exclude_patterns.extend(get_port_excludes(Options.options.port))
+            
+    if Options.options.port == 'wx':
+        features.append('curl')
+        exclude_patterns.extend(['*CFNet.cpp', 'test*bindings.*', "WebDOMCanvas*.cpp", "WebDOMSVG*.cpp"])
+        
     full_dirs = get_dirs_for_features(wk_root, features=features, dirs=webcore_dirs)
 
+    # make sure we don't use the CF networking engine
+    if Options.options.port == 'wx' and sys.platform.startswith('darwin'):
+        full_dirs.remove('Source/WebCore/platform/network/cf')
+        
     jscore_dir = os.path.join(wk_root, 'Source', 'JavaScriptCore')
     for item in os.listdir(jscore_dir):
         fullpath = os.path.join(jscore_dir, item)
@@ -228,8 +293,6 @@ def build(bld):
 
     wk_includes.append('Source')
     wk_includes.append(os.path.join(jscore_dir, 'collector', 'handles'))
-    wk_includes.append(os.path.join(jscore_dir, 'wtf', 'unicode'))
-    wk_includes.append(os.path.join(jscore_dir, 'wtf', 'unicode', 'icu'))
     wk_includes += common_includes + full_dirs
     if sys.platform.startswith('darwin'):
         wk_includes.append(os.path.join(webcore_dir, 'icu'))
@@ -243,6 +306,7 @@ def build(bld):
         # we have to make sure <unicode/utf8.h> picks up the ICU one first.
         global msvclibs_dir
         wk_includes.append(os.path.join(msvclibs_dir, 'include'))
+        wk_includes.append('Source/WebCore/platform/graphics/win')
     else:
         cxxflags.extend(['-include', 'WebCorePrefix.h'])
 
@@ -261,21 +325,21 @@ def build(bld):
         
     excludes = []
     
-    if build_port == 'wx':
+    if Options.options.port == 'wx':
         excludes = get_excludes(webcore_dir, exclude_patterns)
         excludes.extend(['UserStyleSheetLoader.cpp', 'RenderMediaControls.cpp'])
 
         # intermediate sources
         excludes.append('DocTypeStrings.cpp')
         excludes.append('HTMLEntityNames.cpp')
-        excludes.append('tokenizer.cpp')
 
         # Qt specific file in common sources
         excludes.append('ContextShadow.cpp')
 
-        # FIXME: these three require headers that I can't seem to find in trunk.
+        # FIXME: these require headers that I can't seem to find in trunk.
         # Investigate how to resolve these issues.
         excludes.append('JSAbstractView.cpp')
+        excludes.append('JSIntentConstructor.cpp')
         excludes.append('JSPositionCallback.cpp')
         excludes.append('JSInspectorController.cpp')
         
@@ -289,7 +353,6 @@ def build(bld):
         excludes.append('JSSVGStyleTable.cpp')
         excludes.append('JSSVGTests.cpp')
         excludes.append('JSSVGStylable.cpp')
-        excludes.append('JSSVGZoomAndPan.cpp')
         
         # These are files that expect methods not in the base C++ class, usually XYZAnimated methods.
         excludes.append('JSSVGFitToViewBox.cpp')
@@ -309,8 +372,35 @@ def build(bld):
         excludes.append('WebDOMScriptProfileNode.cpp')
         excludes.append('WebNativeEventListener.cpp')
         
-        # This file appears not to build with older versions of ICU
+        # FIXME: It appears these are no longer needed by any port, once this is confirmed,
+        # we should remove these sources from the tree.
+        excludes.append('WebDOMDOMWindowCustom.cpp')
+        excludes.append('WebDOMHTMLOptionsCollectionCustom.cpp')
+        excludes.append('WebDOMNodeCustom.cpp')
+        excludes.append('WebDOMHTMLDocumentCustom.cpp')
+        excludes.append('WebDOMHTMLCollectionCustom.cpp')
+        excludes.append('WebNativeNodeFilterCondition.cpp')
+        excludes.append('WebDOMNodeFilterCustom.cpp')
+        
+        # this file is unused by any port, not sure why it was
+        # left in the tree
+        excludes.append('GeneratedImage.cpp')
+        
+        # features we don't build / use
+        excludes.append('JSNavigatorCustom.cpp')
+        excludes.append('WebGLContextEvent.cpp')
+        excludes.append('FileSystemPOSIX.cpp')
+        excludes.append('LocaleICU.cpp')
+        excludes.append('LocalizedDateICU.cpp')
+        excludes.append('PlatformGestureRecognizer.cpp')
+        excludes.append('SharedBufferPOSIX.cpp')
+        excludes.append('TouchAdjustment.cpp')
+        excludes.append('DNSResolveQueue.cpp')
+        excludes.append('WebDOMRadioNodeList.cpp')
+        
+        # These files appear not to build with older versions of ICU
         excludes.append('LocalizedNumberICU.cpp')
+        excludes.append('LocaleToScriptMappingICU.cpp')
         
         if building_on_win32:
             excludes.append('SharedTimerWx.cpp')
@@ -322,26 +412,39 @@ def build(bld):
         excludes.append('AuthenticationCF.cpp')
         excludes.append('LoaderRunLoopCF.cpp')
         excludes.append('ResourceErrorCF.cpp')
+        excludes.append('RunLoopCF.cpp')
         
         # once we move over to the new FPD implementation, remove this.
         excludes.append('FontPlatformData.cpp')
         
+        # we need a better system to exclude CF stuff
+        excludes.append('HyphenationCF.cpp')
+        
         if sys.platform.startswith('darwin'):
-            webcore.includes += ' Source/WebKit/mac/WebCoreSupport WebCore/platform/mac'
+            webcore.includes += ' Source/WebKit/mac/WebCoreSupport Source/WebCore/platform/mac'
             webcore.source += ' Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm'
             
         if building_on_win32:
             for wxlib in bld.env['LIB_WX']:
+                wx_version = wxpresets.get_wx_version(os.environ['WXWIN'])
+                if int(wx_version[1]) % 2 == 1:
+                    wxlib = wxlib.replace(''.join(wx_version[:2]), ''.join(wx_version))
                 wxlibname = os.path.join(bld.env['LIBPATH_WX'][0], wxlib + '_vc.dll')
+                print "Copying %s" % wxlibname
                 if os.path.exists(wxlibname):
                     bld.install_files(webcore.install_path, [wxlibname])
         
             for dep in windows_deps:
                 bld.install_files(webcore.install_path, [os.path.join(msvclibs_dir, dep)])
-
+            
+            if "CAIRO_ROOT" in os.environ and Options.options.cairo:
+                cairo_bin_dir = os.path.join(os.environ["CAIRO_ROOT"], "bin") 
+                for dep in glob.glob(os.path.join(cairo_bin_dir, "*.dll")):
+                    bld.install_files(webcore.install_path, [os.path.join(cairo_bin_dir, dep)])
+                    
     webcore.find_sources_in_dirs(full_dirs, excludes = excludes, exts=['.c', '.cpp'])
 
     bld.add_group()
     
-    if build_port == "wx":    
+    if Options.options.port == "wx":    
         bld.add_subdirs(['Tools/DumpRenderTree', 'Tools/wx/browser', 'Source/WebKit/wx/bindings/python'])