SConstruct (8897:1021e1f313d0) SConstruct (8946:fb6c89334b86)
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

--- 472 unchanged lines hidden (view full) ---

481Export('MakeAction')
482
483CXX_version = readCommand([main['CXX'],'--version'], exception=False)
484CXX_V = readCommand([main['CXX'],'-V'], exception=False)
485
486main['GCC'] = CXX_version and CXX_version.find('g++') >= 0
487main['SUNCC'] = CXX_V and CXX_V.find('Sun C++') >= 0
488main['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

--- 472 unchanged lines hidden (view full) ---

481Export('MakeAction')
482
483CXX_version = readCommand([main['CXX'],'--version'], exception=False)
484CXX_V = readCommand([main['CXX'],'-V'], exception=False)
485
486main['GCC'] = CXX_version and CXX_version.find('g++') >= 0
487main['SUNCC'] = CXX_V and CXX_V.find('Sun C++') >= 0
488main['ICC'] = CXX_V and CXX_V.find('Intel') >= 0
489main['CLANG'] = CXX_V and CXX_V.find('clang') >= 0
489main['CLANG'] = CXX_version and CXX_version.find('clang') >= 0
490if main['GCC'] + main['SUNCC'] + main['ICC'] + main['CLANG'] > 1:
491 print 'Error: How can we have two at the same time?'
492 Exit(1)
493
494# Set up default C++ compiler flags
495if main['GCC']:
496 main.Append(CCFLAGS=['-pipe'])
497 main.Append(CCFLAGS=['-fno-strict-aliasing'])
498 main.Append(CCFLAGS=['-Wall', '-Wno-sign-compare', '-Wundef'])
490if main['GCC'] + main['SUNCC'] + main['ICC'] + main['CLANG'] > 1:
491 print 'Error: How can we have two at the same time?'
492 Exit(1)
493
494# Set up default C++ compiler flags
495if main['GCC']:
496 main.Append(CCFLAGS=['-pipe'])
497 main.Append(CCFLAGS=['-fno-strict-aliasing'])
498 main.Append(CCFLAGS=['-Wall', '-Wno-sign-compare', '-Wundef'])
499 main.Append(CXXFLAGS=['-Wno-deprecated'])
500 # Read the GCC version to check for versions with bugs
501 # Note CCVERSION doesn't work here because it is run with the CC
502 # before we override it from the command line
503 gcc_version = readCommand([main['CXX'], '-dumpversion'], exception=False)
504 main['GCC_VERSION'] = gcc_version
505 if not compareVersions(gcc_version, '4.4.1') or \
506 not compareVersions(gcc_version, '4.4.2'):
507 print 'Info: Tree vectorizer in GCC 4.4.1 & 4.4.2 is buggy, disabling.'
508 main.Append(CCFLAGS=['-fno-tree-vectorize'])
499 # Read the GCC version to check for versions with bugs
500 # Note CCVERSION doesn't work here because it is run with the CC
501 # before we override it from the command line
502 gcc_version = readCommand([main['CXX'], '-dumpversion'], exception=False)
503 main['GCC_VERSION'] = gcc_version
504 if not compareVersions(gcc_version, '4.4.1') or \
505 not compareVersions(gcc_version, '4.4.2'):
506 print 'Info: Tree vectorizer in GCC 4.4.1 & 4.4.2 is buggy, disabling.'
507 main.Append(CCFLAGS=['-fno-tree-vectorize'])
508 if compareVersions(gcc_version, '4.6') >= 0:
509 main.Append(CXXFLAGS=['-std=c++0x'])
509elif main['ICC']:
510 pass #Fix me... add warning flags once we clean up icc warnings
511elif main['SUNCC']:
512 main.Append(CCFLAGS=['-Qoption ccfe'])
513 main.Append(CCFLAGS=['-features=gcc'])
514 main.Append(CCFLAGS=['-features=extensions'])
515 main.Append(CCFLAGS=['-library=stlport4'])
516 main.Append(CCFLAGS=['-xar'])

--- 11 unchanged lines hidden (view full) ---

528 print 'Error: Unable to determine clang version.'
529 Exit(1)
530
531 main.Append(CCFLAGS=['-pipe'])
532 main.Append(CCFLAGS=['-fno-strict-aliasing'])
533 main.Append(CCFLAGS=['-Wall', '-Wno-sign-compare', '-Wundef'])
534 main.Append(CCFLAGS=['-Wno-tautological-compare'])
535 main.Append(CCFLAGS=['-Wno-self-assign'])
510elif main['ICC']:
511 pass #Fix me... add warning flags once we clean up icc warnings
512elif main['SUNCC']:
513 main.Append(CCFLAGS=['-Qoption ccfe'])
514 main.Append(CCFLAGS=['-features=gcc'])
515 main.Append(CCFLAGS=['-features=extensions'])
516 main.Append(CCFLAGS=['-library=stlport4'])
517 main.Append(CCFLAGS=['-xar'])

--- 11 unchanged lines hidden (view full) ---

529 print 'Error: Unable to determine clang version.'
530 Exit(1)
531
532 main.Append(CCFLAGS=['-pipe'])
533 main.Append(CCFLAGS=['-fno-strict-aliasing'])
534 main.Append(CCFLAGS=['-Wall', '-Wno-sign-compare', '-Wundef'])
535 main.Append(CCFLAGS=['-Wno-tautological-compare'])
536 main.Append(CCFLAGS=['-Wno-self-assign'])
537 # Ruby makes frequent use of extraneous parantheses in the printing
538 # of if-statements
539 main.Append(CCFLAGS=['-Wno-parentheses'])
540
541 if compareVersions(clang_version, "3") >= 0:
542 main.Append(CXXFLAGS=['-std=c++0x'])
536else:
537 print 'Error: Don\'t know what compiler options to use for your compiler.'
538 print ' Please fix SConstruct and src/SConscript and try again.'
539 Exit(1)
540
541# Set up common yacc/bison flags (needed for Ruby)
542main['YACCFLAGS'] = '-d'
543main['YACCHXXFILESUFFIX'] = '.hh'

--- 496 unchanged lines hidden ---
543else:
544 print 'Error: Don\'t know what compiler options to use for your compiler.'
545 print ' Please fix SConstruct and src/SConscript and try again.'
546 Exit(1)
547
548# Set up common yacc/bison flags (needed for Ruby)
549main['YACCFLAGS'] = '-d'
550main['YACCHXXFILESUFFIX'] = '.hh'

--- 496 unchanged lines hidden ---