SConstruct (9224:b0539d08bda8) SConstruct (9227:c208c904ab13)
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

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

160AddLocalOption('--colors', dest='use_colors', action='store_true',
161 help="Add color to abbreviated scons output")
162AddLocalOption('--no-colors', dest='use_colors', action='store_false',
163 help="Don't add color to abbreviated scons output")
164AddLocalOption('--default', dest='default', type='string', action='store',
165 help='Override which build_opts file to use for defaults')
166AddLocalOption('--ignore-style', dest='ignore_style', action='store_true',
167 help='Disable style checking hooks')
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

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

160AddLocalOption('--colors', dest='use_colors', action='store_true',
161 help="Add color to abbreviated scons output")
162AddLocalOption('--no-colors', dest='use_colors', action='store_false',
163 help="Don't add color to abbreviated scons output")
164AddLocalOption('--default', dest='default', type='string', action='store',
165 help='Override which build_opts file to use for defaults')
166AddLocalOption('--ignore-style', dest='ignore_style', action='store_true',
167 help='Disable style checking hooks')
168AddLocalOption('--no-lto', dest='no_lto', action='store_true',
169 help='Disable Link-Time Optimization for fast')
168AddLocalOption('--update-ref', dest='update_ref', action='store_true',
169 help='Update test reference outputs')
170AddLocalOption('--verbose', dest='verbose', action='store_true',
171 help='Print full tool command lines')
172
173termcap = get_termcap(GetOption('use_colors'))
174
175########################################################################

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

472 main['ARCOMSTR'] = Transform("AR", 0)
473 main['LINKCOMSTR'] = Transform("LINK", 0)
474 main['RANLIBCOMSTR'] = Transform("RANLIB", 0)
475 main['M4COMSTR'] = Transform("M4")
476 main['SHCCCOMSTR'] = Transform("SHCC")
477 main['SHCXXCOMSTR'] = Transform("SHCXX")
478Export('MakeAction')
479
170AddLocalOption('--update-ref', dest='update_ref', action='store_true',
171 help='Update test reference outputs')
172AddLocalOption('--verbose', dest='verbose', action='store_true',
173 help='Print full tool command lines')
174
175termcap = get_termcap(GetOption('use_colors'))
176
177########################################################################

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

474 main['ARCOMSTR'] = Transform("AR", 0)
475 main['LINKCOMSTR'] = Transform("LINK", 0)
476 main['RANLIBCOMSTR'] = Transform("RANLIB", 0)
477 main['M4COMSTR'] = Transform("M4")
478 main['SHCCCOMSTR'] = Transform("SHCC")
479 main['SHCXXCOMSTR'] = Transform("SHCXX")
480Export('MakeAction')
481
482# Initialize the Link-Time Optimization (LTO) flags
483main['LTO_CCFLAGS'] = []
484main['LTO_LDFLAGS'] = []
485
480CXX_version = readCommand([main['CXX'],'--version'], exception=False)
481CXX_V = readCommand([main['CXX'],'-V'], exception=False)
482
483main['GCC'] = CXX_version and CXX_version.find('g++') >= 0
484main['SUNCC'] = CXX_V and CXX_V.find('Sun C++') >= 0
485main['ICC'] = CXX_V and CXX_V.find('Intel') >= 0
486main['CLANG'] = CXX_version and CXX_version.find('clang') >= 0
487if main['GCC'] + main['SUNCC'] + main['ICC'] + main['CLANG'] > 1:

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

501 if not compareVersions(gcc_version, '4.4.1') or \
502 not compareVersions(gcc_version, '4.4.2'):
503 print 'Info: Tree vectorizer in GCC 4.4.1 & 4.4.2 is buggy, disabling.'
504 main.Append(CCFLAGS=['-fno-tree-vectorize'])
505 # c++0x support in gcc is useful already from 4.4, see
506 # http://gcc.gnu.org/projects/cxx0x.html for details
507 if compareVersions(gcc_version, '4.4') >= 0:
508 main.Append(CXXFLAGS=['-std=c++0x'])
486CXX_version = readCommand([main['CXX'],'--version'], exception=False)
487CXX_V = readCommand([main['CXX'],'-V'], exception=False)
488
489main['GCC'] = CXX_version and CXX_version.find('g++') >= 0
490main['SUNCC'] = CXX_V and CXX_V.find('Sun C++') >= 0
491main['ICC'] = CXX_V and CXX_V.find('Intel') >= 0
492main['CLANG'] = CXX_version and CXX_version.find('clang') >= 0
493if main['GCC'] + main['SUNCC'] + main['ICC'] + main['CLANG'] > 1:

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

507 if not compareVersions(gcc_version, '4.4.1') or \
508 not compareVersions(gcc_version, '4.4.2'):
509 print 'Info: Tree vectorizer in GCC 4.4.1 & 4.4.2 is buggy, disabling.'
510 main.Append(CCFLAGS=['-fno-tree-vectorize'])
511 # c++0x support in gcc is useful already from 4.4, see
512 # http://gcc.gnu.org/projects/cxx0x.html for details
513 if compareVersions(gcc_version, '4.4') >= 0:
514 main.Append(CXXFLAGS=['-std=c++0x'])
515
516 # LTO support is only really working properly from 4.6 and beyond
517 if compareVersions(gcc_version, '4.6') >= 0:
518 # Add the appropriate Link-Time Optimization (LTO) flags
519 # unless LTO is explicitly turned off. Note that these flags
520 # are only used by the fast target.
521 if not GetOption('no_lto'):
522 # Pass the LTO flag when compiling to produce GIMPLE
523 # output, we merely create the flags here and only append
524 # them later/
525 main['LTO_CCFLAGS'] = ['-flto=%d' % GetOption('num_jobs')]
526
527 # Use the same amount of jobs for LTO as we are running
528 # scons with, we hardcode the use of the linker plugin
529 # which requires either gold or GNU ld >= 2.21
530 main['LTO_LDFLAGS'] = ['-flto=%d' % GetOption('num_jobs'),
531 '-fuse-linker-plugin']
532
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'])

--- 562 unchanged lines hidden ---
533elif main['ICC']:
534 pass #Fix me... add warning flags once we clean up icc warnings
535elif main['SUNCC']:
536 main.Append(CCFLAGS=['-Qoption ccfe'])
537 main.Append(CCFLAGS=['-features=gcc'])
538 main.Append(CCFLAGS=['-features=extensions'])
539 main.Append(CCFLAGS=['-library=stlport4'])
540 main.Append(CCFLAGS=['-xar'])

--- 562 unchanged lines hidden ---