SConstruct (8655:e4001326a5ba) | SConstruct (8737:770ccf3af571) |
---|---|
1# -*- mode:python -*- 2 3# Copyright (c) 2011 Advanced Micro Devices, Inc. 4# Copyright (c) 2009 The Hewlett-Packard Development Company 5# Copyright (c) 2004-2005 The Regents of The University of Michigan 6# All rights reserved. 7# 8# Redistribution and use in source and binary forms, with or without --- 459 unchanged lines hidden (view full) --- 468Export('MakeAction') 469 470CXX_version = readCommand([main['CXX'],'--version'], exception=False) 471CXX_V = readCommand([main['CXX'],'-V'], exception=False) 472 473main['GCC'] = CXX_version and CXX_version.find('g++') >= 0 474main['SUNCC'] = CXX_V and CXX_V.find('Sun C++') >= 0 475main['ICC'] = CXX_V and CXX_V.find('Intel') >= 0 | 1# -*- mode:python -*- 2 3# Copyright (c) 2011 Advanced Micro Devices, Inc. 4# Copyright (c) 2009 The Hewlett-Packard Development Company 5# Copyright (c) 2004-2005 The Regents of The University of Michigan 6# All rights reserved. 7# 8# Redistribution and use in source and binary forms, with or without --- 459 unchanged lines hidden (view full) --- 468Export('MakeAction') 469 470CXX_version = readCommand([main['CXX'],'--version'], exception=False) 471CXX_V = readCommand([main['CXX'],'-V'], exception=False) 472 473main['GCC'] = CXX_version and CXX_version.find('g++') >= 0 474main['SUNCC'] = CXX_V and CXX_V.find('Sun C++') >= 0 475main['ICC'] = CXX_V and CXX_V.find('Intel') >= 0 |
476if main['GCC'] + main['SUNCC'] + main['ICC'] > 1: | 476main['CLANG'] = CXX_V and CXX_V.find('clang') >= 0 477if main['GCC'] + main['SUNCC'] + main['ICC'] + main['CLANG'] > 1: |
477 print 'Error: How can we have two at the same time?' 478 Exit(1) 479 480# Set up default C++ compiler flags 481if main['GCC']: 482 main.Append(CCFLAGS=['-pipe']) 483 main.Append(CCFLAGS=['-fno-strict-aliasing']) 484 main.Append(CCFLAGS=['-Wall', '-Wno-sign-compare', '-Wundef']) --- 11 unchanged lines hidden (view full) --- 496 pass #Fix me... add warning flags once we clean up icc warnings 497elif main['SUNCC']: 498 main.Append(CCFLAGS=['-Qoption ccfe']) 499 main.Append(CCFLAGS=['-features=gcc']) 500 main.Append(CCFLAGS=['-features=extensions']) 501 main.Append(CCFLAGS=['-library=stlport4']) 502 main.Append(CCFLAGS=['-xar']) 503 #main.Append(CCFLAGS=['-instances=semiexplicit']) | 478 print 'Error: How can we have two at the same time?' 479 Exit(1) 480 481# Set up default C++ compiler flags 482if main['GCC']: 483 main.Append(CCFLAGS=['-pipe']) 484 main.Append(CCFLAGS=['-fno-strict-aliasing']) 485 main.Append(CCFLAGS=['-Wall', '-Wno-sign-compare', '-Wundef']) --- 11 unchanged lines hidden (view full) --- 497 pass #Fix me... add warning flags once we clean up icc warnings 498elif main['SUNCC']: 499 main.Append(CCFLAGS=['-Qoption ccfe']) 500 main.Append(CCFLAGS=['-features=gcc']) 501 main.Append(CCFLAGS=['-features=extensions']) 502 main.Append(CCFLAGS=['-library=stlport4']) 503 main.Append(CCFLAGS=['-xar']) 504 #main.Append(CCFLAGS=['-instances=semiexplicit']) |
505elif main['CLANG']: 506 clang_version_re = re.compile(".* version (\d+\.\d+)") 507 clang_version_match = clang_version_re.match(CXX_version) 508 if (clang_version_match): 509 clang_version = clang_version_match.groups()[0] 510 if compareVersions(clang_version, "2.9") < 0: 511 print 'Error: clang version 2.9 or newer required.' 512 print ' Installed version:', clang_version 513 Exit(1) 514 else: 515 print 'Error: Unable to determine clang version.' 516 Exit(1) 517 518 main.Append(CCFLAGS=['-pipe']) 519 main.Append(CCFLAGS=['-fno-strict-aliasing']) 520 main.Append(CCFLAGS=['-Wall', '-Wno-sign-compare', '-Wundef']) 521 main.Append(CCFLAGS=['-Wno-tautological-compare']) 522 main.Append(CCFLAGS=['-Wno-self-assign']) |
|
504else: 505 print 'Error: Don\'t know what compiler options to use for your compiler.' 506 print ' Please fix SConstruct and src/SConscript and try again.' 507 Exit(1) 508 509# Set up common yacc/bison flags (needed for Ruby) 510main['YACCFLAGS'] = '-d' 511main['YACCHXXFILESUFFIX'] = '.hh' --- 499 unchanged lines hidden --- | 523else: 524 print 'Error: Don\'t know what compiler options to use for your compiler.' 525 print ' Please fix SConstruct and src/SConscript and try again.' 526 Exit(1) 527 528# Set up common yacc/bison flags (needed for Ruby) 529main['YACCFLAGS'] = '-d' 530main['YACCHXXFILESUFFIX'] = '.hh' --- 499 unchanged lines hidden --- |