Changeset 38647 in webkit for trunk/JavaScriptCore/JavaScriptCore.scons
- Timestamp:
- Nov 20, 2008, 5:10:51 PM (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/JavaScriptCore/JavaScriptCore.scons
r38544 r38647 1 import os2 import sys3 from subprocess import Popen, PIPE4 5 1 # The keys in sources are the paths to the directories 6 2 # the values are an array of source files in those directories to compile … … 56 52 'runtime/CallData.cpp', 57 53 'runtime/Collector.cpp', 54 'runtime/Completion.cpp', 58 55 'runtime/CommonIdentifiers.cpp', 59 56 'runtime/ConstructData.cpp', … … 132 129 ] 133 130 sources['wrec'] = [ 134 'wrec/CharacterClass.cpp' 135 'wrec/CharacterClass.h' 131 'wrec/CharacterClass.cpp', 136 132 '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', 145 137 ] 146 138 sources['wtf'] = [ … … 148 140 'wtf/FastMalloc.cpp', 149 141 'wtf/HashTable.cpp', 150 'wtf/MainThread.cpp',151 142 'wtf/RefCountedLeakCounter.cpp', 152 'wtf/TCSystemAlloc.cpp',153 143 'wtf/dtoa.cpp', 154 144 ] … … 163 153 env = Environment() 164 154 155 building_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 161 if 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 175 if env['PLATFORM'] == 'win32': 176 env.AppendENVPath('PATH', 'c:/Program Files/Xoreax/IncrediBuild') 177 165 178 if env['PLATFORM'] == 'darwin': 166 179 sources['API'].append('API/JSStringRefCF.cpp') 167 180 sources['profiler'].append('profiler/ProfilerServer.mm') 168 181 sources['wtf'].append('wtf/ThreadingPthreads.cpp') 182 sources['wtf'].append('wtf/MainThread.cpp') 169 183 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') 185 elif building_on_win32: 186 sources['wtf'].append('wtf/ThreadingNone.cpp') 187 env.Append(CPPDEFINES = ['ENABLE_JSC_MULTIPLE_THREADS=0']) 175 188 176 189 derived_sources_path = 'DerivedSources/JavaScriptCore/' … … 205 218 206 219 # 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 221 if env['PLATFORM'] == 'win32': 222 env.AppendENVPath('PATH', 'C:/cygwin/bin') 223 env.Command(derived_sources_results, derived_sources_sources, 'bash make-generated-sources.sh') 224 sources[derived_sources_path] = [DerivedSources('Grammar.cpp')] 209 225 210 226 # Handle os-version specific build settings 211 227 if env['PLATFORM'] == 'darwin': 228 from subprocess import Popen, PIPE 212 229 version_pieces = Popen(["sw_vers", "-productVersion"], stdout = PIPE).communicate()[0].split('.') 213 230 if map(int, version_pieces)[:2] > (10, 5): … … 217 234 # This build file builds the Chromium port for now, support for 218 235 # others could be added later. 219 env['CPPDEFINES'] = 'BUILDING_CHROMIUM__' 236 env.Append(CPPDEFINES = ['BUILDING_CHROMIUM__']) 237 238 # I'm not certain how many of these windows defines are actually required. 239 if building_on_win32: 240 env.Append(CPPDEFINES = ['_WIN32_WINNT=0x0600', 'WINVER=0x0600', 'WIN32', '_WINDOWS', 'NOMINMAX', 'UNICODE', '_UNICODE', '__STD_C', '_HAS_EXCEPTIONS=0']) 220 241 221 242 # Scons out-of-the-box only supports precompiled headers for MSVC … … 223 244 if env['CC'] == 'gcc': 224 245 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' 226 249 227 250 if env['PLATFORM'] == 'darwin': 228 251 env['FRAMEWORKS'] = ['CoreFoundation', 'Foundation'] 229 252 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 256 webkit_libraries_path = "../WebKitLibraries/win/" 257 def WebKitLibraries(path): 258 return webkit_libraries_path + path 259 260 include_paths = ['.', '..', 'ForwardingHeaders'] + sources.keys() 261 env.Append(CPPPATH = include_paths) 262 if 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 268 jsc_env = env.Clone() 269 270 if building_on_win32: 271 env.StaticLibrary("JavaScriptCore", sources.values()) 272 else: 273 env.SharedLibrary("JavaScriptCore", sources.values()) 274 275 276 env = jsc_env 235 277 236 278 # Build the jsc testing shell … … 238 280 build_directory = '.' # This should be changed to point to wherever JavaScriptCore gets built to 239 281 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 284 env['CPPPATH'] = include_paths 285 env['LIBS'] = ['JavaScriptCore'] 286 env['LIBPATH'] = [build_directory] 287 288 if env['PLATFORM'] == 'darwin': 289 env.Append(LIBS = ['edit']) 290 elif building_on_win32: 291 env.Append(CPPPATH = [WebKitLibraries('include')]) 292 env.Prepend(LIBPATH = [WebKitLibraries('lib')]) 293 env.Append(LIBS = ['icuin', 'icuuc', 'user32', 'winmm']) 294 241 295 env.Program('jsc', shell_sources)
Note:
See TracChangeset
for help on using the changeset viewer.