2011-02-01 Ojan Vafai <ojan@chromium.org>
[WebKit-https.git] / wscript
diff --git a/wscript b/wscript
index 94ac739b5fb57f47568db83acb711a777e296d37..d0c1faef46db04a9cb6254c287383cc316219d95 100644 (file)
--- a/wscript
+++ b/wscript
@@ -30,24 +30,26 @@ import Options
 from settings import *
 
 if build_port == "wx":
 from settings import *
 
 if build_port == "wx":
-    webcore_dirs.extend(['WebKit/wx', 'WebKit/wx/WebKitSupport'])
-
-wk_includes = ['.', 'WebCore', 'WebCore/DerivedSources',
-                os.path.join(wk_root, 'JavaScriptCore'),
-                os.path.join(wk_root, 'JavaScriptCore', 'wtf', 'text'),
-                os.path.join(wk_root, 'WebCore'),
+    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),
                 os.path.join(output_dir),
-                'WebCore/platform/image-decoders',
-                'WebCore/platform/win',
-                'WebCore/workers',
         ]
 
 if build_port == "wx":
         ]
 
 if build_port == "wx":
-    wk_includes.append(os.path.join(wk_root, 'WebKit/wx'))
-    wk_includes.append('WebCore/platform/wx/wxcode')
+    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"):
 
 if sys.platform.startswith("win"):
-    wk_includes.append(os.path.join(wk_root, 'WebCore','platform','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',
 
 windows_deps = [
                 'lib/pthreadVC2.dll',
@@ -59,55 +61,57 @@ windows_deps = [
 webcore_sources = {}
 
 if build_port == "wx":
 webcore_sources = {}
 
 if build_port == "wx":
-    webcore_sources['wx'] = ['WebCore/platform/KillRingNone.cpp', 'WebCore/bindings/cpp/WebDOMEventTarget.cpp']  
+    webcore_sources['wx'] = ['Source/WebCore/platform/KillRingNone.cpp',
+                             'Source/WebCore/bindings/cpp/WebDOMEventTarget.cpp']  
 
     if building_on_win32:
         # make sure platform/wx comes after this so we get the right
         # FontPlatformData.h
 
     if building_on_win32:
         # make sure platform/wx comes after this so we get the right
         # FontPlatformData.h
-        webcore_dirs.extend(['WebCore/platform/wx/wxcode/win', 'WebCore/plugins/win'])
+        webcore_dirs.extend(['Source/WebCore/platform/wx/wxcode/win', 'Source/WebCore/plugins/win'])
         webcore_sources['wx-win'] = [
         webcore_sources['wx-win'] = [
-               'WebCore/platform/graphics/win/GlyphPageTreeNodeCairoWin.cpp',
-               'WebCore/platform/graphics/win/TransformationMatrixWin.cpp',
+               '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).
                # 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).
-               'WebCore/platform/win/SharedTimerWin.cpp',
-               'WebCore/platform/win/WebCoreInstanceHandle.cpp',
+               'Source/WebCore/platform/win/SharedTimerWin.cpp',
+               'Source/WebCore/platform/win/WebCoreInstanceHandle.cpp',
                # Use the Windows plugin architecture
                # Use the Windows plugin architecture
-               #'WebCore/plugins/win/PluginDataWin.cpp',
-               'WebCore/plugins/win/PluginDatabaseWin.cpp',
-               'WebCore/plugins/win/PluginMessageThrottlerWin.cpp',
-               'WebCore/plugins/win/PluginPackageWin.cpp',
-               'WebCore/plugins/win/PluginViewWin.cpp',
+               #'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'):
         ]
     elif sys.platform.startswith('darwin'):
-        webcore_dirs.append('WebCore/plugins/mac')
-        webcore_dirs.append('WebCore/platform/wx/wxcode/mac/carbon')
-        webcore_dirs.append('WebCore/platform/mac')
-        webcore_dirs.append('WebCore/platform/text/mac')
+        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'] = [
         webcore_sources['wx-mac'] = [
-               'WebCore/platform/mac/PurgeableBufferMac.cpp',
-               'WebCore/platform/mac/WebCoreNSStringExtras.mm',
-               'WebCore/platform/mac/WebCoreSystemInterface.mm',
-               'WebCore/platform/graphics/cg/FloatSizeCG.cpp',
-               'WebCore/platform/graphics/mac/ComplexTextController.cpp',
-               'WebCore/platform/graphics/mac/ComplexTextControllerCoreText.cpp',
-               'WebCore/platform/graphics/mac/ComplexTextControllerATSUI.cpp',
-               'WebCore/platform/graphics/mac/GlyphPageTreeNodeMac.cpp',
-               'WebCore/platform/graphics/mac/SimpleFontDataATSUI.mm',
-               'WebCore/platform/graphics/mac/SimpleFontDataCoreText.cpp',
-               'WebCore/platform/graphics/wx/FontPlatformDataWxMac.mm',
-               'WebCore/platform/text/mac/ShapeArabic.c',
-               'WebCore/platform/wx/wxcode/mac/carbon/fontprops.mm',
-               'WebCore/plugins/mac/PluginPackageMac.cpp',
-               'WebCore/plugins/mac/PluginViewMac.mm'
+               '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'] = [
         ]
     else:
         webcore_sources['wx-gtk'] = [
-               'WebCore/plugins/PluginViewNone.cpp',
-               'WebCore/plugins/PluginPackageNone.cpp'
+               'Source/WebCore/plugins/PluginViewNone.cpp',
+               'Source/WebCore/plugins/PluginPackageNone.cpp'
         ]
         ]
-        webcore_dirs.append('WebCore/platform/wx/wxcode/gtk')
+        webcore_dirs.append('Source/WebCore/platform/wx/wxcode/gtk')
         
 import TaskGen
 from TaskGen import taskgen, feature, after
         
 import TaskGen
 from TaskGen import taskgen, feature, after
@@ -164,7 +168,7 @@ def configure(conf):
     generate_jscore_derived_sources()
     generate_webcore_derived_sources()
     if build_port == "wx" and sys.platform.startswith('win'):
     generate_jscore_derived_sources()
     generate_webcore_derived_sources()
     if build_port == "wx" and sys.platform.startswith('win'):
-        graphics_dir = os.path.join(wk_root, 'WebCore', 'platform', 'graphics')
+        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.
         # 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.
@@ -174,22 +178,23 @@ def configure(conf):
     webcore_out_dir = os.path.join(output_dir, 'WebCore')
     if not os.path.exists(webcore_out_dir):
         os.makedirs(webcore_out_dir)
     webcore_out_dir = os.path.join(output_dir, 'WebCore')
     if not os.path.exists(webcore_out_dir):
         os.makedirs(webcore_out_dir)
-    shutil.copy('WebCore/platform/mac/WebCoreSystemInterface.h', os.path.join(output_dir, 'WebCore', 'WebCoreSystemInterface.h'))
+    shutil.copy('Source/WebCore/platform/mac/WebCoreSystemInterface.h', os.path.join(output_dir, 'WebCore', 'WebCoreSystemInterface.h'))
     jscore_out_dir = os.path.join(output_dir, 'JavaScriptCore')
     if not os.path.exists(jscore_out_dir):
         os.makedirs(jscore_out_dir)
     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)))
 
     jscore_out_dir = os.path.join(output_dir, 'JavaScriptCore')
     if not os.path.exists(jscore_out_dir):
         os.makedirs(jscore_out_dir)
     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 Options.options.wxpython:
+    if build_port == "wx" and Options.options.wxpython:
         common_configure(conf)
         common_configure(conf)
-        conf.check_tool('swig', tooldir='WebKit/wx/bindings/python')
+        conf.check_tool('swig', tooldir='Source/WebKit/wx/bindings/python')
         conf.check_swig_version('1.3.29')
 
 def build(bld):  
     import TaskGen
     global wk_includes
 
         conf.check_swig_version('1.3.29')
 
 def build(bld):  
     import TaskGen
     global wk_includes
 
+    # FIXME: Does this need to be Source/JavaScriptCore?
     bld.add_subdirs('JavaScriptCore')
 
     if sys.platform.startswith('darwin'):
     bld.add_subdirs('JavaScriptCore')
 
     if sys.platform.startswith('darwin'):
@@ -199,7 +204,7 @@ def build(bld):
     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',
     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"]
+            'test*bindings.*', '*WinCE.cpp', "WebDOMCanvas*.cpp", "WebDOMSVG*.cpp"]
     if build_port == 'wx':
         features.append('curl')
         exclude_patterns.append('*Win.cpp')
     if build_port == 'wx':
         features.append('curl')
         exclude_patterns.append('*Win.cpp')
@@ -212,7 +217,7 @@ def build(bld):
 
     full_dirs = get_dirs_for_features(wk_root, features=features, dirs=webcore_dirs)
 
 
     full_dirs = get_dirs_for_features(wk_root, features=features, dirs=webcore_dirs)
 
-    jscore_dir = os.path.join(wk_root, 'JavaScriptCore')
+    jscore_dir = os.path.join(wk_root, 'Source', 'JavaScriptCore')
     for item in os.listdir(jscore_dir):
         fullpath = os.path.join(jscore_dir, item)
         if os.path.isdir(fullpath) and not item == "os-win32" and not item == 'icu':
     for item in os.listdir(jscore_dir):
         fullpath = os.path.join(jscore_dir, item)
         if os.path.isdir(fullpath) and not item == "os-win32" and not item == 'icu':
@@ -250,13 +255,13 @@ def build(bld):
         excludes.extend(['UserStyleSheetLoader.cpp', 'RenderMediaControls.cpp'])
 
         # intermediate sources
         excludes.extend(['UserStyleSheetLoader.cpp', 'RenderMediaControls.cpp'])
 
         # intermediate sources
-        excludes.append('ColorData.cpp')
-        excludes.append('CSSValueKeywords.cpp')
-        excludes.append('CSSPropertyNames.cpp')
         excludes.append('DocTypeStrings.cpp')
         excludes.append('HTMLEntityNames.cpp')
         excludes.append('tokenizer.cpp')
 
         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.
         # Investigate how to resolve these issues.
         excludes.append('JSAbstractView.cpp')
         # FIXME: these three require headers that I can't seem to find in trunk.
         # Investigate how to resolve these issues.
         excludes.append('JSAbstractView.cpp')
@@ -305,12 +310,21 @@ def build(bld):
         excludes.append('ResourceErrorCF.cpp')
         
         if sys.platform.startswith('darwin'):
         excludes.append('ResourceErrorCF.cpp')
         
         if sys.platform.startswith('darwin'):
-            webcore.includes += ' WebKit/mac/WebCoreSupport WebCore/platform/mac'
-            webcore.source += " WebKit/mac/WebCoreSupport/WebSystemInterface.mm"
+            webcore.includes += ' Source/WebKit/mac/WebCoreSupport WebCore/platform/mac'
+            webcore.source += ' Source/WebKit/mac/WebCoreSupport/WebSystemInterface.mm'
             
             
+        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(webcore.install_path, [wxlibname])
+        
+            for dep in windows_deps:
+                bld.install_files(webcore.install_path, [os.path.join(msvclibs_dir, dep)])
+
     webcore.find_sources_in_dirs(full_dirs, excludes = excludes, exts=['.c', '.cpp'])
 
     bld.add_group()
     
     webcore.find_sources_in_dirs(full_dirs, excludes = excludes, exts=['.c', '.cpp'])
 
     bld.add_group()
     
-    if build_port == "wx":
-        bld.add_subdirs(['WebKitTools/DumpRenderTree', 'WebKitTools/wx/browser', 'WebKit/wx/bindings/python'])
+    if build_port == "wx":    
+        bld.add_subdirs(['Tools/DumpRenderTree', 'Tools/wx/browser', 'Source/WebKit/wx/bindings/python'])