aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/SConstruct
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/SConstruct')
-rw-r--r--linden/indra/SConstruct89
1 files changed, 62 insertions, 27 deletions
diff --git a/linden/indra/SConstruct b/linden/indra/SConstruct
index 68c8fc7..3de5e4f 100644
--- a/linden/indra/SConstruct
+++ b/linden/indra/SConstruct
@@ -184,13 +184,20 @@ for build_target in targets:
184 ./llcommon ./llmath ./llwindow ./llaudio ./llcharacter 184 ./llcommon ./llmath ./llwindow ./llaudio ./llcharacter
185 ./lldatabase ./llhavok ./llimage ./llinventory ./llmedia ./llmessage 185 ./lldatabase ./llhavok ./llimage ./llinventory ./llmedia ./llmessage
186 ./llprimitive ./llrender ./llscene ./llui ./llvfs ./llwindow 186 ./llprimitive ./llrender ./llscene ./llui ./llvfs ./llwindow
187 ./llxml ./lscript 187 ./llxml ./lscript ./lscript/lscript_compile
188 ../libraries/include 188 ../libraries/include
189 ../libraries/include/havok 189 ../libraries/include/havok
190 """ + 190 """ +
191 '../libraries/' + system_str + '/include' ) 191 '../libraries/' + system_str + '/include' )
192 192
193 client_external_libs = ['resolv'] 193 if platform == 'linux' and build_target == 'client':
194 if arch == 'x86_64' and os.path.exists('/usr/lib64'):
195 client_external_libs = [File('/usr/lib64/libresolv.a')]
196 else:
197 client_external_libs = ['llresolv6']
198 else:
199 client_external_libs = ['resolv']
200
194 system_link_flags = '' 201 system_link_flags = ''
195 202
196 if platform != 'linux' and build_target == 'client' and enable_mozlib: 203 if platform != 'linux' and build_target == 'client' and enable_mozlib:
@@ -240,7 +247,7 @@ for build_target in targets:
240 cppflags += server_cppflags + ' ' 247 cppflags += server_cppflags + ' '
241 else: 248 else:
242 # Viewer flags 249 # Viewer flags
243 cflags += '-falign-loops=16 -fno-math-errno -fexceptions -fsigned-char -fno-strict-aliasing -ffast-math ' 250 cflags += '-fno-math-errno -fexceptions -fsigned-char -fno-strict-aliasing '
244 cppflags += '-DLL_MESA_HEADLESS=0 -DLL_MESA=0 ' 251 cppflags += '-DLL_MESA_HEADLESS=0 -DLL_MESA=0 '
245 try: 252 try:
246 client_cppflags = os.environ['CLIENT_CPPFLAGS'] 253 client_cppflags = os.environ['CLIENT_CPPFLAGS']
@@ -283,32 +290,44 @@ for build_target in targets:
283 cflags += '-x c++ -arch ppc -pipe -Wno-trigraphs -fpascal-strings -faltivec -fasm-blocks -g -fmessage-length=0 -mtune=G4 -Wno-deprecated-declarations -Wno-invalid-offsetof -mmacosx-version-min=10.3 -Wmost -Wno-sign-compare -Wno-switch -fconstant-cfstrings -ffor-scope -Wno-reorder ' 290 cflags += '-x c++ -arch ppc -pipe -Wno-trigraphs -fpascal-strings -faltivec -fasm-blocks -g -fmessage-length=0 -mtune=G4 -Wno-deprecated-declarations -Wno-invalid-offsetof -mmacosx-version-min=10.3 -Wmost -Wno-sign-compare -Wno-switch -fconstant-cfstrings -ffor-scope -Wno-reorder '
284 cppflags += '-x c++ -DLL_DARWIN=1 -fpch-preprocess -F./newview/build/Deployment -fconstant-cfstrings -isysroot /Developer/SDKs/MacOSX10.3.9.sdk ' 291 cppflags += '-x c++ -DLL_DARWIN=1 -fpch-preprocess -F./newview/build/Deployment -fconstant-cfstrings -isysroot /Developer/SDKs/MacOSX10.3.9.sdk '
285 292
293 if standalone:
294 gcc_bin = 'g++'
295 elif build_target != 'client':
296 gcc_bin = 'g++-3.3'
297 elif arch == 'x86_64cross':
298 gcc_bin = '/opt/crosstool/gcc-4.0.2-glibc-2.3.6/x86_64-unknown-linux-gnu/bin/x86_64-unknown-linux-gnu-gcc'
299 strip_cmd = '/opt/crosstool/gcc-4.0.2-glibc-2.3.6/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/bin/strip -S -o $TARGET $SOURCE'
300
301 else:
302 gcc_bin = 'g++-3.4'
303
304 # Are we using the Intel compiler?
305 if gcc_bin.find('icpc') >= 0:
306 cflags += '-wr193,654,981,1125 -w1 '
307 elif build_target == 'client':
308 cflags += '-falign-loops=16 -ffast-math '
309
286 cxxflags += cflags 310 cxxflags += cflags
287 311
288 ### Build type-specific flags ### 312 ### Build type-specific flags ###
289 313
290 debug_cflags = cflags + '-fno-inline -O0 ' 314 debug_cflags = cflags + '-fno-inline -O0 '
315 debug_cxxflags = cxxflags + '-fno-inline -O0 '
291 debug_cppflags = cppflags + '-D_DEBUG -DLL_DEBUG=1 ' 316 debug_cppflags = cppflags + '-D_DEBUG -DLL_DEBUG=1 '
292 debug_cxxflags = cxxflags
293 release_cflags = cflags + '-O2 ' 317 release_cflags = cflags + '-O2 '
318 release_cxxflags = cxxflags + '-O2 '
294 release_cppflags = cppflags + '-DNDEBUG -DLL_RELEASE=1 ' 319 release_cppflags = cppflags + '-DNDEBUG -DLL_RELEASE=1 '
295 release_cxxflags = cxxflags
296 releasenoopt_cflags = cflags + '-O0 ' 320 releasenoopt_cflags = cflags + '-O0 '
321 releasenoopt_cxxflags = cxxflags + '-O0 '
297 releasenoopt_cppflags = cppflags + '-DNDEBUG -DLL_RELEASE=1 ' 322 releasenoopt_cppflags = cppflags + '-DNDEBUG -DLL_RELEASE=1 '
298 releasenoopt_cxxflags = cxxflags
299 releasefordownload_cflags = cflags + '-O2 ' 323 releasefordownload_cflags = cflags + '-O2 '
324 releasefordownload_cxxflags = cxxflags + '-O2 '
300 releasefordownload_cppflags = cppflags + '-DNDEBUG -DLL_RELEASE=1 -DLL_RELEASE_FOR_DOWNLOAD=1 ' 325 releasefordownload_cppflags = cppflags + '-DNDEBUG -DLL_RELEASE=1 -DLL_RELEASE_FOR_DOWNLOAD=1 '
301 releasefordownload_cxxflags = cxxflags
302 326
303 ################ 327 ################
304 # ENVIRONMENT # 328 # ENVIRONMENT #
305 ################ 329 ################
306 330
307 if standalone:
308 gcc_bin = 'g++'
309 else:
310 gcc_bin = 'g++-3.4'
311
312 # If you strip more aggressively than -S then the quality of crash- 331 # If you strip more aggressively than -S then the quality of crash-
313 # logger backtraces deteriorates. 332 # logger backtraces deteriorates.
314 strip_cmd = 'strip -S -o $TARGET $SOURCE' 333 strip_cmd = 'strip -S -o $TARGET $SOURCE'
@@ -324,13 +343,6 @@ for build_target in targets:
324 else: 343 else:
325 hidesyms_cmd = 'cp -f $SOURCE $TARGET' 344 hidesyms_cmd = 'cp -f $SOURCE $TARGET'
326 345
327 if build_target != 'client':
328 gcc_bin = 'g++-3.3'
329
330 if arch == 'x86_64cross':
331 gcc_bin = '/opt/crosstool/gcc-4.0.2-glibc-2.3.6/x86_64-unknown-linux-gnu/bin/x86_64-unknown-linux-gnu-gcc'
332 strip_cmd = '/opt/crosstool/gcc-4.0.2-glibc-2.3.6/x86_64-unknown-linux-gnu/x86_64-unknown-linux-gnu/bin/strip -S -o $TARGET $SOURCE'
333
334 compiler = gcc_bin 346 compiler = gcc_bin
335 compiler_no_distcc = compiler 347 compiler_no_distcc = compiler
336 if enable_distcc: 348 if enable_distcc:
@@ -380,6 +392,18 @@ for build_target in targets:
380 392
381 env_no_distcc = env.Copy(CXX = compiler_no_distcc) 393 env_no_distcc = env.Copy(CXX = compiler_no_distcc)
382 394
395 vec_match = re.compile("_vec\.")
396 env_vec = env.Copy() # _vec is for default vector optimizations or none
397
398 sse_match = re.compile("_sse\.")
399 env_sse = env.Copy()
400 env_sse.Append(CPPFLAGS = ' -msse -mfpmath=sse')
401
402 sse2_match = re.compile("_sse2\.")
403 env_sse2 = env.Copy()
404 env_sse2.Append(CPPFLAGS = ' -msse2 -mfpmath=sse')
405
406
383 ### Distributed build hosts ### 407 ### Distributed build hosts ###
384 408
385 if enable_distcc: 409 if enable_distcc:
@@ -407,6 +431,21 @@ for build_target in targets:
407 # HELPER FUNCTIONS # 431 # HELPER FUNCTIONS #
408 ##################### 432 #####################
409 433
434 ## handle special compiler modes
435
436 def file_obj(file):
437 if file == 'newsim/lltask.cpp':
438 print 'Found lltask!'
439 return env_no_distcc.Object(file)
440 elif vec_match.search(file) != None:
441 return env_vec.Object(file)
442 elif sse_match.search(file) != None:
443 return env_sse.Object(file)
444 elif sse2_match.search(file) != None:
445 return env_sse2.Object(file)
446 else:
447 return file
448
410 ### Load a files.lst and files.PLATFORM.lst for each module ### 449 ### Load a files.lst and files.PLATFORM.lst for each module ###
411 450
412 def load_files(module, source_fname): 451 def load_files(module, source_fname):
@@ -417,12 +456,7 @@ for build_target in targets:
417 for x in list: 456 for x in list:
418 if not x.startswith('#'): 457 if not x.startswith('#'):
419 file = os.path.join(build_dir, x) 458 file = os.path.join(build_dir, x)
420 if x == 'newsim/lltask.cpp': 459 new_list.append(file_obj(file))
421 print 'Found lltask!'
422 obj = env_no_distcc.Object(file)
423 new_list.append(obj)
424 else:
425 new_list.append(file)
426 list_file.close() 460 list_file.close()
427 except IOError, val: 461 except IOError, val:
428 print 'Error: unable to open file list',source_fname, 462 print 'Error: unable to open file list',source_fname,
@@ -434,7 +468,7 @@ for build_target in targets:
434 list = Split(platform_list_file.read()) 468 list = Split(platform_list_file.read())
435 for x in list: 469 for x in list:
436 file = os.path.join(build_dir, x) 470 file = os.path.join(build_dir, x)
437 new_list.append(file) 471 new_list.append(file_obj(file))
438 platform_list_file.close() 472 platform_list_file.close()
439 except IOError: 473 except IOError:
440 return new_list 474 return new_list
@@ -559,7 +593,8 @@ for build_target in targets:
559 if arch != 'x86_64' and arch != 'x86_64cross': 593 if arch != 'x86_64' and arch != 'x86_64cross':
560 if enable_fmod: 594 if enable_fmod:
561 external_libs += [ 'fmod-3.75' ] 595 external_libs += [ 'fmod-3.75' ]
562 external_libs += ['tcmalloc', 'stacktrace'] 596 if buildtype == 'debug':
597 external_libs += ['tcmalloc', 'stacktrace']
563 598
564 external_libs.remove('cares') 599 external_libs.remove('cares')
565 600