]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - wscript
JavaScriptCore-903.5.tar.gz
[apple/javascriptcore.git] / wscript
diff --git a/wscript b/wscript
index 61ad1fbc972b7dc2a165a12827e3d7137785b159..3df3ded546839691ffaddf95668c0b6996e5f414 100644 (file)
--- a/wscript
+++ b/wscript
@@ -29,47 +29,26 @@ import commands
 
 from settings import *
 
-jscore_excludes = ['jsc.cpp', 'ucptable.cpp']
-jscore_excludes.extend(get_excludes(jscore_dir, ['*Brew.cpp', '*CF.cpp', '*Symbian.cpp']))
-
-sources = []
+def build(bld):
 
-jscore_excludes.extend(get_excludes(jscore_dir, ['*None.cpp']))
+    import Options
 
-if building_on_win32:
-    jscore_excludes += ['ExecutableAllocatorPosix.cpp', 'MarkStackPosix.cpp', 'ThreadingPthreads.cpp']
-    sources += ['jit/ExecutableAllocatorWin.cpp', 'runtime/MarkStackWin.cpp']
-else:
-    jscore_excludes.append('JSStringRefBSTR.cpp')
-    jscore_excludes.extend(get_excludes(jscore_dir, ['*Win.cpp']))
+    jscore_excludes = ['jsc.cpp', 'ProfilerServer.mm', 'ExecutableAllocatorPosix.cpp']
+    jscore_excludes.extend(get_excludes(jscore_dir, ['*Brew.cpp', '*CF.cpp', '*Symbian.cpp']))
 
-def generate_jscore_derived_sources():
-    # build the derived sources
-    js_dir = jscore_dir
-    if building_on_win32:
-        js_dir = get_output('cygpath --unix "%s"' % js_dir)
-    derived_sources_dir = os.path.join(jscore_dir, 'DerivedSources')
-    if not os.path.exists(derived_sources_dir):
-        os.mkdir(derived_sources_dir)
+    jscore_excludes.extend(get_excludes(jscore_dir, ['*None.cpp']))
 
-    olddir = os.getcwd()
-    os.chdir(derived_sources_dir)
+    sources = []
 
-    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))
-    os.system(command)
-    os.chdir(olddir)
+    if Options.options.port == "wx":
+        if building_on_win32:
+            jscore_excludes += ['MarkStackPosix.cpp', 'OSAllocatorPosix.cpp', 'ThreadingPthreads.cpp']
+            sources += ['heap/MarkStackWin.cpp']
+        else:
+            jscore_excludes.append('JSStringRefBSTR.cpp')
+            jscore_excludes.extend(get_excludes(jscore_dir, ['*Win.cpp']))
 
-def set_options(opt):
-    common_set_options(opt)
-
-def configure(conf):
-    common_configure(conf)
-    generate_jscore_derived_sources()
-    
-def build(bld):
-    import Options
-
-    full_dirs = get_dirs_for_features(jscore_dir, features=[build_port], dirs=jscore_dirs)
+    full_dirs = get_dirs_for_features(jscore_dir, features=[Options.options.port.lower()], dirs=jscore_dirs)
 
     includes = common_includes + full_dirs
     if sys.platform.startswith('darwin'):
@@ -85,8 +64,8 @@ def build(bld):
         uselib_local = '',
         install_path = output_dir)
 
-    jscore.find_sources_in_dirs(full_dirs, excludes = jscore_excludes)  
-        
+    jscore.find_sources_in_dirs(full_dirs, excludes = jscore_excludes)
+    
     obj = bld.new_task_gen(
         features = 'cxx cprogram',
         includes = '. .. assembler DerivedSources ForwardingHeaders ' + ' '.join(includes),
@@ -97,10 +76,10 @@ def build(bld):
         install_path = output_dir,
         )
         
-    # we'll get an error if exceptions are on because of an unwind error when using __try
     if building_on_win32:
-        flags = obj.env.CXXFLAGS
-        flags.remove('/EHsc')
-        obj.env.CXXFLAGS = flags
+        myenv = obj.env.copy()
+        myenv.CXXFLAGS = myenv.CXXFLAGS[:]
+        myenv.CXXFLAGS.remove('/EHsc')
+        obj.env = myenv
 
     bld.install_files(os.path.join(output_dir, 'JavaScriptCore'), 'API/*.h')