SConstruct (8737:770ccf3af571) SConstruct (8805:42dd80cf4cb4)
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
476main['CLANG'] = CXX_V and CXX_V.find('clang') >= 0
477if main['GCC'] + main['SUNCC'] + main['ICC'] + main['CLANG'] > 1:
476if main['GCC'] + main['SUNCC'] + main['ICC'] > 1:
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'])
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'])
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'])
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'

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

808 if GetOption('verbose'):
809 print "Reading", joinpath(root, 'SConsopts')
810 SConscript(joinpath(root, 'SConsopts'))
811
812all_isa_list.sort()
813
814sticky_vars.AddVariables(
815 EnumVariable('TARGET_ISA', 'Target ISA', 'alpha', all_isa_list),
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'

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

789 if GetOption('verbose'):
790 print "Reading", joinpath(root, 'SConsopts')
791 SConscript(joinpath(root, 'SConsopts'))
792
793all_isa_list.sort()
794
795sticky_vars.AddVariables(
796 EnumVariable('TARGET_ISA', 'Target ISA', 'alpha', all_isa_list),
816 BoolVariable('FULL_SYSTEM', 'Full-system support', False),
817 ListVariable('CPU_MODELS', 'CPU models',
818 sorted(n for n,m in CpuModel.dict.iteritems() if m.default),
819 sorted(CpuModel.list)),
820 BoolVariable('NO_FAST_ALLOC', 'Disable fast object allocator', False),
821 BoolVariable('FORCE_FAST_ALLOC',
822 'Enable fast object allocator, even for m5.debug', False),
823 BoolVariable('FAST_ALLOC_STATS', 'Enable fast object allocator statistics',
824 False),

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

832 False),
833 BoolVariable('USE_POSIX_CLOCK', 'Use POSIX Clocks', have_posix_clock),
834 BoolVariable('USE_FENV', 'Use <fenv.h> IEEE mode control', have_fenv),
835 BoolVariable('USE_CHECKER', 'Use checker for detailed CPU models', False),
836 BoolVariable('CP_ANNOTATE', 'Enable critical path annotation capability', False),
837 )
838
839# These variables get exported to #defines in config/*.hh (see src/SConscript).
797 ListVariable('CPU_MODELS', 'CPU models',
798 sorted(n for n,m in CpuModel.dict.iteritems() if m.default),
799 sorted(CpuModel.list)),
800 BoolVariable('NO_FAST_ALLOC', 'Disable fast object allocator', False),
801 BoolVariable('FORCE_FAST_ALLOC',
802 'Enable fast object allocator, even for m5.debug', False),
803 BoolVariable('FAST_ALLOC_STATS', 'Enable fast object allocator statistics',
804 False),

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

812 False),
813 BoolVariable('USE_POSIX_CLOCK', 'Use POSIX Clocks', have_posix_clock),
814 BoolVariable('USE_FENV', 'Use <fenv.h> IEEE mode control', have_fenv),
815 BoolVariable('USE_CHECKER', 'Use checker for detailed CPU models', False),
816 BoolVariable('CP_ANNOTATE', 'Enable critical path annotation capability', False),
817 )
818
819# These variables get exported to #defines in config/*.hh (see src/SConscript).
840export_vars += ['FULL_SYSTEM', 'USE_FENV',
841 'NO_FAST_ALLOC', 'FORCE_FAST_ALLOC', 'FAST_ALLOC_STATS',
842 'SS_COMPATIBLE_FP', 'USE_CHECKER', 'TARGET_ISA', 'CP_ANNOTATE',
843 'USE_POSIX_CLOCK' ]
820export_vars += ['USE_FENV', 'NO_FAST_ALLOC', 'FORCE_FAST_ALLOC',
821 'FAST_ALLOC_STATS', 'SS_COMPATIBLE_FP', 'USE_CHECKER',
822 'TARGET_ISA', 'CP_ANNOTATE', 'USE_POSIX_CLOCK' ]
844
845###################################################
846#
847# Define a SCons builder for configuration flag headers.
848#
849###################################################
850
851# This function generates a config header file that #defines the

--- 178 unchanged lines hidden ---
823
824###################################################
825#
826# Define a SCons builder for configuration flag headers.
827#
828###################################################
829
830# This function generates a config header file that #defines the

--- 178 unchanged lines hidden ---