]> git.saurik.com Git - apple/javascriptcore.git/blobdiff - wscript
JavaScriptCore-1097.3.tar.gz
[apple/javascriptcore.git] / wscript
diff --git a/wscript b/wscript
index f5a041f77d4b7eccadd4b47fcc9f97c738a98bd9..4afb4d26a632787467b6bd822c841cbe285c4536 100644 (file)
--- a/wscript
+++ b/wscript
@@ -29,65 +29,54 @@ import commands
 
 from settings import *
 
-jscore_excludes = ['jsc.cpp', 'ucptable.cpp']
-jscore_excludes.extend(get_excludes(jscore_dir, ['*CF.cpp', '*Symbian.cpp']))
-
-sources = []
-
-jscore_excludes.extend(get_excludes(jscore_dir, ['*None.cpp']))
+def build(bld):
 
-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']))
+    import Options
 
-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 = ['jsc.cpp', 'ExecutableAllocatorPosix.cpp', 'LLIntOffsetsExtractor.cpp']
+    jscore_exclude_patterns = get_port_excludes(Options.options.port)
+    jscore_exclude_patterns.append('*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 += ['OSAllocatorPosix.cpp', 'ThreadingPthreads.cpp']
+            sources.extend(['../WTF/wtf/ThreadingWin.cpp', '../WTF/wtf/ThreadSpecificWin.cpp', '../WTF/wtf/OSAllocatorWin.cpp'])
+        else:
+            jscore_excludes.append('JSStringRefBSTR.cpp')
 
-def set_options(opt):
-    common_set_options(opt)
+    if sys.platform.startswith('darwin'):
+        jscore_excludes.append('GCActivityCallback.cpp') # this is an empty impl.
 
-def configure(conf):
-    common_configure(conf)
-    generate_jscore_derived_sources()
-    
-def build(bld):
-    import Options
+    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))
 
-    full_dirs = get_dirs_for_features(jscore_dir, features=[build_port], dirs=jscore_dirs)
+    jscore_excludes.extend(get_excludes_in_dirs(abs_dirs, jscore_exclude_patterns))
 
-    includes = common_includes + full_dirs
+    includes = common_includes + full_dirs + [output_dir]
+    if sys.platform.startswith('darwin'):
+        includes.append(os.path.join(jscore_dir, 'icu'))
 
     # 1. A simple program
     jscore = bld.new_task_gen(
-        features = 'cxx cstaticlib',
-        includes = '. .. assembler wrec DerivedSources ForwardingHeaders ' + ' '.join(includes),
+        features = 'cc cxx cshlib',
+        includes = '. .. assembler ../WTF ' + ' '.join(includes),
         source = sources,
+        defines = ['BUILDING_JavaScriptCore'],
         target = 'jscore',
         uselib = 'WX ICU ' + get_config(),
         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 wrec DerivedSources ForwardingHeaders ' + ' '.join(includes),
+        includes = '. .. assembler ../WTF ' + ' '.join(includes),
         source = 'jsc.cpp',
         target = 'jsc',
         uselib = 'WX ICU ' + get_config(),
@@ -95,10 +84,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')
+    bld.add_group()