[wx] Unreviewed. Fix the build after WTF move.
authorkevino@webkit.org <kevino@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 25 Mar 2012 01:41:33 +0000 (01:41 +0000)
committerkevino@webkit.org <kevino@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Sun, 25 Mar 2012 01:41:33 +0000 (01:41 +0000)
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@112017 268f45cc-cd09-0410-ab3c-d52691b4dbfc

ChangeLog
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/wscript
Tools/ChangeLog
Tools/waf/build/build_utils.py
Tools/waf/build/settings.py
wscript

index b83c230..4fa2997 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2012-03-24  Kevin Ollivier  <kevino@theolliviers.com>
+
+        [wx] Unreviewed. Fix the build after WTF move.
+
+        * wscript:
+
 2012-03-23  Dave Michael  <dmichael@chromium.org>
 
         Relanding(r111754): HTMLPluginElement is not destroyed on reload or navigation if getNPObject is called
index 81dbaeb..a6d6072 100644 (file)
@@ -1,3 +1,9 @@
+2012-03-24  Kevin Ollivier  <kevino@theolliviers.com>
+
+        [wx] Unreviewed. Fix the build after WTF move.
+
+        * wscript:
+
 2012-03-23  Filip Pizlo  <fpizlo@apple.com>
 
         DFG double voting may be overzealous in the case of variables that end up
index 64f545e..172c214 100644 (file)
@@ -34,8 +34,8 @@ def build(bld):
     import Options
 
     jscore_excludes = ['jsc.cpp', 'ExecutableAllocatorPosix.cpp', 'LLIntOffsetsExtractor.cpp']
-    jscore_excludes.extend(get_excludes(jscore_dir, ['*CF.cpp', '*Symbian.cpp']))
-    jscore_excludes.extend(get_excludes(jscore_dir, ['*None.cpp']))
+    jscore_exclude_patterns = get_port_excludes(Options.options.port)
+    jscore_exclude_patterns.append('*None.cpp')
 
     sources = []
 
@@ -44,10 +44,17 @@ def build(bld):
             jscore_excludes += ['OSAllocatorPosix.cpp', 'ThreadingPthreads.cpp']
         else:
             jscore_excludes.append('JSStringRefBSTR.cpp')
-            jscore_excludes.extend(get_excludes(jscore_dir, ['*Win.cpp']))
+
+    if sys.platform.startswith('darwin'):
+        jscore_excludes.append('GCActivityCallback.cpp') # this is an empty impl.
 
     bld.env.LIBDIR = output_dir
     full_dirs = get_dirs_for_features(jscore_dir, features=[Options.options.port.lower()], dirs=jscore_dirs)
+    abs_dirs = []
+    for adir in full_dirs:
+        abs_dirs.append(os.path.join(jscore_dir, adir))
+
+    jscore_excludes.extend(get_excludes_in_dirs(abs_dirs, jscore_exclude_patterns))
 
     includes = common_includes + full_dirs
     if sys.platform.startswith('darwin'):
@@ -56,7 +63,7 @@ def build(bld):
     # 1. A simple program
     jscore = bld.new_task_gen(
         features = 'cc cxx cshlib',
-        includes = '. .. assembler ../WTF ../WTF/wtf ' + ' '.join(includes),
+        includes = '. .. assembler ../WTF ' + ' '.join(includes),
         source = sources,
         defines = ['BUILDING_JavaScriptCore'],
         target = 'jscore',
@@ -81,5 +88,3 @@ def build(bld):
         myenv.CXXFLAGS = myenv.CXXFLAGS[:]
         myenv.CXXFLAGS.remove('/EHsc')
         obj.env = myenv
-
-    bld.install_files(os.path.join(output_dir, 'JavaScriptCore'), 'API/*.h')
index bba4488..df7ad19 100644 (file)
@@ -1,3 +1,14 @@
+2012-03-24  Kevin Ollivier  <kevino@theolliviers.com>
+
+        [wx] Unreviewed. Fix the build after WTF move.
+
+        * waf/build/build_utils.py:
+        (get_excludes):
+        (get_excludes_in_dirs):
+        * waf/build/settings.py:
+        (get_port_excludes):
+        (common_configure):
+
 2012-03-24  Dirk Pranke  <dpranke@chromium.org>
 
         clean up NRWT logging/metering, be less verbose
index 7d21f05..1ded6d4 100644 (file)
@@ -48,21 +48,28 @@ def get_output(command):
 
 def get_excludes(root, patterns):
     """
-    Get a list of exclude patterns going down several dirs.
-    TODO: Make this fully recursive.
+    Get a list of exclude patterns for root and all its subdirs.
     """
     excludes = []
 
+    for afile in os.listdir(root):
+        fullpath = os.path.join(root, afile)
+        if os.path.isdir(fullpath):
+            excludes.extend(get_excludes(fullpath, patterns))
+            
     for pattern in patterns:
-        subdir_pattern = os.sep + '*'
-        for subdir in [subdir_pattern, subdir_pattern * 2, subdir_pattern * 3]:
-            adir = root + subdir + os.sep + pattern
-            files = glob.glob(adir)
-            for afile in files:
-                excludes.append(os.path.basename(afile))
+        adir = root + os.sep + pattern
+        files = glob.glob(adir)
+        for afile in files:
+            excludes.append(os.path.basename(afile))
 
     return excludes
 
+def get_excludes_in_dirs(dirs, patterns):
+    excludes = []
+    for adir in dirs:
+        excludes.extend(get_excludes(adir, patterns))
+    return excludes
 
 def get_dirs_for_features(root, features, dirs):
     """
index 6db2472..381ce46 100644 (file)
@@ -77,6 +77,8 @@ ports = [
 uses = [
     'CF',
     'CFNet',
+    'CURL',
+    'WXGC',
 ]
 
 port_uses = {
@@ -98,11 +100,11 @@ jscore_dirs = [
     'profiler',
     'runtime',
     'tools',
-    'wtf',
-    'wtf/dtoa',
-    'wtf/text',
-    'wtf/unicode',
-    'wtf/unicode/icu',
+    '../WTF/wtf',
+    '../WTF/wtf/dtoa',
+    '../WTF/wtf/text',
+    '../WTF/wtf/unicode',
+    '../WTF/wtf/unicode/icu',
     'yarr',
 ]
 
@@ -191,6 +193,26 @@ if building_on_win32:
 
 build_port = default_port
 
+def get_port_excludes(thisport):
+    """
+    This function creates a list of file patterns to exclude
+    based on what port you are using and what USES it has defined.
+    """
+    exclude_patterns = []
+    global ports
+    for port in ports:
+        if not port == thisport:
+            exclude = "*%s.cpp" % port
+            if port == 'Chromium':
+                exclude = "*Chromium*.cpp"
+            exclude_patterns.append(exclude)
+    
+    global uses
+    for use in uses:
+        if thisport not in port_uses or not use in port_uses[thisport]:
+            exclude_patterns.append("*%s.cpp" % use)
+            
+    return exclude_patterns
 
 def get_config():
     waf_configname = config.upper().strip()
@@ -345,7 +367,9 @@ def common_configure(conf):
 
     if sys.platform.startswith('darwin'):
         conf.env['LIB_ICU'] = ['icucore']
-
+        global port_uses
+        port_uses[build_port].append('CF')
+        
         conf.env.append_value('CPPPATH', wklibs_dir)
         conf.env.append_value('LIBPATH', wklibs_dir)
 
diff --git a/wscript b/wscript
index ab9d3dc..8c17d61 100644 (file)
--- a/wscript
+++ b/wscript
@@ -116,8 +116,9 @@ def build(bld):
         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', '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'),
@@ -219,25 +220,22 @@ def build(bld):
     
     exclude_patterns = ['*AllInOne.cpp', '*None.cpp',]
 
+    if sys.platform.startswith('darwin'):
+        features.append('cf')
+
     # exclude the filename patterns for all other ports.
-    for port in ports:
-        if not port == thisport:
-            exclude = "*%s.cpp" % port
-            if port == 'Chromium':
-                exclude = "*Chromium*.cpp"
-            exclude_patterns.append(exclude)
+    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"])
         
-    if sys.platform.startswith('darwin'):
-        features.append('cf')
-    else:
-        exclude_patterns.append('*CF.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)
@@ -246,8 +244,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'))
@@ -266,7 +262,7 @@ def build(bld):
 
     webcore = bld.new_task_gen(
         features = 'cc cxx cshlib',
-        includes = 'Source/WTF ' + ' '.join(wk_includes),
+        includes = ' '.join(wk_includes),
         source = ' '.join(flattenSources(webcore_sources.values())),
         cxxflags = cxxflags,
         defines = ['WXMAKINGDLL_WEBKIT', 'BUILDING_WebCore'],