Changeset 38647 in webkit


Ignore:
Timestamp:
Nov 20, 2008 5:10:51 PM (15 years ago)
Author:
eric@webkit.org
Message:

Reviewed by Darin Adler.

Make JavaScriptCore Chromium build under Windows (cmd only, cygwin almost works)
https://bugs.webkit.org/show_bug.cgi?id=22347

  • JavaScriptCore.scons:
  • parser/Parser.cpp: Add using std::auto_ptr since we use auto_ptr
Location:
trunk/JavaScriptCore
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/JavaScriptCore/ChangeLog

    r38646 r38647  
     12008-11-20  Eric Seidel  <eric@webkit.org>
     2
     3        Reviewed by Darin Adler.
     4
     5        Make JavaScriptCore Chromium build under Windows (cmd only, cygwin almost works)
     6        https://bugs.webkit.org/show_bug.cgi?id=22347
     7
     8        * JavaScriptCore.scons:
     9        * parser/Parser.cpp: Add using std::auto_ptr since we use auto_ptr
     10
    1112008-11-20  Steve Falkenburg  <sfalken@apple.com>
    212
  • trunk/JavaScriptCore/JavaScriptCore.scons

    r38544 r38647  
    1 import os
    2 import sys
    3 from subprocess import Popen, PIPE
    4 
    51# The keys in sources are the paths to the directories
    62# the values are an array of source files in those directories to compile
     
    5652    'runtime/CallData.cpp',
    5753    'runtime/Collector.cpp',
     54    'runtime/Completion.cpp',
    5855    'runtime/CommonIdentifiers.cpp',
    5956    'runtime/ConstructData.cpp',
     
    132129]
    133130sources['wrec'] = [
    134     'wrec/CharacterClass.cpp'
    135     'wrec/CharacterClass.h'
     131    'wrec/CharacterClass.cpp',
    136132    'wrec/CharacterClassConstructor.cpp',
    137     'wrec/Quantifier.h'
    138     'wrec/WREC.cpp'
    139     'wrec/WRECFunctors.cpp'
    140     'wrec/WRECFunctors.h'
    141     'wrec/WRECGenerator.cpp'
    142     'wrec/WRECGenerator.h'
    143     'wrec/WRECParser.cpp'
    144     'wrec/WRECParser.h'
     133    'wrec/WREC.cpp',
     134    'wrec/WRECFunctors.cpp',
     135    'wrec/WRECGenerator.cpp',
     136    'wrec/WRECParser.cpp',
    145137]
    146138sources['wtf'] = [
     
    148140    'wtf/FastMalloc.cpp',
    149141    'wtf/HashTable.cpp',
    150     'wtf/MainThread.cpp',
    151142    'wtf/RefCountedLeakCounter.cpp',
    152     'wtf/TCSystemAlloc.cpp',
    153143    'wtf/dtoa.cpp',
    154144]
     
    163153env = Environment()
    164154
     155building_on_win32 = env['PLATFORM'] == 'win32' or env['PLATFORM'] == 'cygwin'
     156
     157# Scons uses gcc when building under cygwin by default
     158# We also have to manually force 8.0 or Scons will try and
     159# look up what version to use using the registry and fail
     160# due to lack of cygwin-python registry support
     161if env['PLATFORM'] == 'cygwin':
     162    env['MSVS_VERSION'] = '8.0'
     163    # Some systems have PROGRAMFILES, some have ProgramFiles
     164    # Scons msvc tool only expects 'ProgramFiles'
     165    import os
     166    if os.getenv('PROGRAMFILES') and not os.getenv('ProgramFiles'):
     167        os.environ['ProgramFiles'] = os.getenv('PROGRAMFILES')
     168
     169    env.Tool('msvc')
     170    env.Tool('mslink')
     171    env.Tool('mslib')
     172
     173# Scons is failing to carry the %PATH% value through correctly
     174# Hack IncrediBuild into our path so cl.exe doesn't crash
     175if env['PLATFORM'] == 'win32':
     176    env.AppendENVPath('PATH', 'c:/Program Files/Xoreax/IncrediBuild')
     177
    165178if env['PLATFORM'] == 'darwin':
    166179    sources['API'].append('API/JSStringRefCF.cpp')
    167180    sources['profiler'].append('profiler/ProfilerServer.mm')
    168181    sources['wtf'].append('wtf/ThreadingPthreads.cpp')
     182    sources['wtf'].append('wtf/MainThread.cpp')
    169183    sources['wtf/mac'] = ['wtf/mac/MainThreadMac.mm']
    170 elif env['PLATFORM'] == 'win32':
    171     sources['API'].append('API/JSStringRefBSTR.cpp')
    172     sources['wtf'].append('wtf/ThreadingWin.cpp')
    173     sources['wtf/win'] = ['wtf/win/MainThreadWin.cpp']
    174 
     184    sources['wtf'].append('wtf/TCSystemAlloc.cpp')
     185elif building_on_win32:
     186    sources['wtf'].append('wtf/ThreadingNone.cpp')
     187    env.Append(CPPDEFINES = ['ENABLE_JSC_MULTIPLE_THREADS=0'])
    175188
    176189derived_sources_path = 'DerivedSources/JavaScriptCore/'
     
    205218
    206219# Generate DerivedSources
    207 env.Command(derived_sources_results, derived_sources_sources, './make-generated-sources.sh')
    208 sources[derived_sources_path] = [DerivedSources('grammar.cpp')]
     220# Make sure Windows knows where bash (and all the other cygwin commands) live
     221if env['PLATFORM'] == 'win32':
     222    env.AppendENVPath('PATH', 'C:/cygwin/bin')
     223env.Command(derived_sources_results, derived_sources_sources, 'bash make-generated-sources.sh')
     224sources[derived_sources_path] = [DerivedSources('Grammar.cpp')]
    209225
    210226# Handle os-version specific build settings
    211227if env['PLATFORM'] == 'darwin':
     228    from subprocess import Popen, PIPE
    212229    version_pieces = Popen(["sw_vers", "-productVersion"], stdout = PIPE).communicate()[0].split('.')
    213230    if map(int, version_pieces)[:2] > (10, 5):
     
    217234# This build file builds the Chromium port for now, support for
    218235# others could be added later.
    219 env['CPPDEFINES'] = 'BUILDING_CHROMIUM__'
     236env.Append(CPPDEFINES = ['BUILDING_CHROMIUM__'])
     237
     238# I'm not certain how many of these windows defines are actually required.
     239if building_on_win32:
     240    env.Append(CPPDEFINES = ['_WIN32_WINNT=0x0600', 'WINVER=0x0600', 'WIN32', '_WINDOWS', 'NOMINMAX', 'UNICODE', '_UNICODE', '__STD_C', '_HAS_EXCEPTIONS=0'])
    220241
    221242# Scons out-of-the-box only supports precompiled headers for MSVC
     
    223244if env['CC'] == 'gcc':
    224245    env['CCFLAGS'] = '-include JavaScriptCorePrefix.h'
    225 env['PCH'] = 'JavaScriptCorePrefix.h'
     246# Turns out the MSVC PCH support is badly broken
     247# env['PCH'] = 'JavaScriptCorePrefix.h'
     248# env['PCHSTOP'] = 'JavaScriptCorePrefix.h'
    226249
    227250if env['PLATFORM'] == 'darwin':
    228251    env['FRAMEWORKS'] = ['CoreFoundation', 'Foundation']
    229252    env['LIBS'] = ['icucore']
    230 
    231 include_paths = ['.', '..', 'ForwardingHeaders', 'icu'] + sources.keys()
    232 env['CPPPATH'] = include_paths
    233 env.SharedLibrary("JavaScriptCore", sources.values())
    234 
     253    # Apple does not ship the ICU headers with Mac OS X, so WebKit includes a copy of 3.2 headers
     254    env.Append(CPPPATH = 'icu')
     255
     256webkit_libraries_path = "../WebKitLibraries/win/"
     257def WebKitLibraries(path):
     258    return webkit_libraries_path + path
     259
     260include_paths = ['.', '..', 'ForwardingHeaders'] + sources.keys()
     261env.Append(CPPPATH = include_paths)
     262if building_on_win32:
     263    env.Append(CPPPATH = [WebKitLibraries('include')])
     264    env.Prepend(LIBPATH = [WebKitLibraries('lib')])
     265    env.Append(LIBS = ['icuin', 'icuuc', 'user32', 'winmm'])
     266
     267# Save off a copy of the environment for use with jsc
     268jsc_env = env.Clone()
     269
     270if building_on_win32:
     271    env.StaticLibrary("JavaScriptCore", sources.values())
     272else:
     273    env.SharedLibrary("JavaScriptCore", sources.values())
     274
     275
     276env = jsc_env
    235277
    236278# Build the jsc testing shell
     
    238280build_directory = '.' # This should be changed to point to wherever JavaScriptCore gets built to
    239281
    240 env = Environment(CPPPATH = include_paths, LIBS = ['JavaScriptCore', 'edit'], LIBPATH = [build_directory])
     282# It's hacky to re-use the same environment from JavaScriptCore
     283# but it makes building on windows easier for now
     284env['CPPPATH'] = include_paths
     285env['LIBS'] = ['JavaScriptCore']
     286env['LIBPATH'] = [build_directory]
     287
     288if env['PLATFORM'] == 'darwin':
     289    env.Append(LIBS = ['edit'])
     290elif building_on_win32:
     291    env.Append(CPPPATH = [WebKitLibraries('include')])
     292    env.Prepend(LIBPATH = [WebKitLibraries('lib')])
     293    env.Append(LIBS = ['icuin', 'icuuc', 'user32', 'winmm'])
     294
    241295env.Program('jsc', shell_sources)
  • trunk/JavaScriptCore/parser/Parser.cpp

    r38646 r38647  
    2929#include <wtf/Vector.h>
    3030#include <memory>
     31
     32using std::auto_ptr;
    3133
    3234extern int kjsyyparse(void*);
Note: See TracChangeset for help on using the changeset viewer.