SConstruct (9416:4bf9aa9d40bb) SConstruct (9419:54d5c0e5852a)
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

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

504# Initialize the Link-Time Optimization (LTO) flags
505main['LTO_CCFLAGS'] = []
506main['LTO_LDFLAGS'] = []
507
508CXX_version = readCommand([main['CXX'],'--version'], exception=False)
509CXX_V = readCommand([main['CXX'],'-V'], exception=False)
510
511main['GCC'] = CXX_version and CXX_version.find('g++') >= 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

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

504# Initialize the Link-Time Optimization (LTO) flags
505main['LTO_CCFLAGS'] = []
506main['LTO_LDFLAGS'] = []
507
508CXX_version = readCommand([main['CXX'],'--version'], exception=False)
509CXX_V = readCommand([main['CXX'],'-V'], exception=False)
510
511main['GCC'] = CXX_version and CXX_version.find('g++') >= 0
512main['SUNCC'] = CXX_V and CXX_V.find('Sun C++') >= 0
513main['ICC'] = CXX_V and CXX_V.find('Intel') >= 0
514main['CLANG'] = CXX_version and CXX_version.find('clang') >= 0
512main['CLANG'] = CXX_version and CXX_version.find('clang') >= 0
515if main['GCC'] + main['SUNCC'] + main['ICC'] + main['CLANG'] > 1:
513if main['GCC'] + main['CLANG'] > 1:
516 print 'Error: How can we have two at the same time?'
517 Exit(1)
518
519# Set up default C++ compiler flags
520if main['GCC']:
521 main.Append(CCFLAGS=['-pipe'])
522 main.Append(CCFLAGS=['-fno-strict-aliasing'])
523 main.Append(CCFLAGS=['-Wall', '-Wno-sign-compare', '-Wundef'])

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

547 main['LTO_CCFLAGS'] = ['-flto=%d' % GetOption('num_jobs')]
548
549 # Use the same amount of jobs for LTO as we are running
550 # scons with, we hardcode the use of the linker plugin
551 # which requires either gold or GNU ld >= 2.21
552 main['LTO_LDFLAGS'] = ['-flto=%d' % GetOption('num_jobs'),
553 '-fuse-linker-plugin']
554
514 print 'Error: How can we have two at the same time?'
515 Exit(1)
516
517# Set up default C++ compiler flags
518if main['GCC']:
519 main.Append(CCFLAGS=['-pipe'])
520 main.Append(CCFLAGS=['-fno-strict-aliasing'])
521 main.Append(CCFLAGS=['-Wall', '-Wno-sign-compare', '-Wundef'])

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

545 main['LTO_CCFLAGS'] = ['-flto=%d' % GetOption('num_jobs')]
546
547 # Use the same amount of jobs for LTO as we are running
548 # scons with, we hardcode the use of the linker plugin
549 # which requires either gold or GNU ld >= 2.21
550 main['LTO_LDFLAGS'] = ['-flto=%d' % GetOption('num_jobs'),
551 '-fuse-linker-plugin']
552
555elif main['ICC']:
556 pass #Fix me... add warning flags once we clean up icc warnings
557elif main['SUNCC']:
558 main.Append(CCFLAGS=['-Qoption ccfe'])
559 main.Append(CCFLAGS=['-features=gcc'])
560 main.Append(CCFLAGS=['-features=extensions'])
561 main.Append(CCFLAGS=['-library=stlport4'])
562 main.Append(CCFLAGS=['-xar'])
563 #main.Append(CCFLAGS=['-instances=semiexplicit'])
564elif main['CLANG']:
565 clang_version_re = re.compile(".* version (\d+\.\d+)")
566 clang_version_match = clang_version_re.match(CXX_version)
567 if (clang_version_match):
568 clang_version = clang_version_match.groups()[0]
569 if compareVersions(clang_version, "2.9") < 0:
570 print 'Error: clang version 2.9 or newer required.'
571 print ' Installed version:', clang_version

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

592 print "Don't know what compiler options to use for your compiler."
593 print termcap.Yellow + ' compiler:' + termcap.Normal, main['CXX']
594 print termcap.Yellow + ' version:' + termcap.Normal,
595 if not CXX_version:
596 print termcap.Yellow + termcap.Bold + "COMMAND NOT FOUND!" +\
597 termcap.Normal
598 else:
599 print CXX_version.replace('\n', '<nl>')
553elif main['CLANG']:
554 clang_version_re = re.compile(".* version (\d+\.\d+)")
555 clang_version_match = clang_version_re.match(CXX_version)
556 if (clang_version_match):
557 clang_version = clang_version_match.groups()[0]
558 if compareVersions(clang_version, "2.9") < 0:
559 print 'Error: clang version 2.9 or newer required.'
560 print ' Installed version:', clang_version

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

581 print "Don't know what compiler options to use for your compiler."
582 print termcap.Yellow + ' compiler:' + termcap.Normal, main['CXX']
583 print termcap.Yellow + ' version:' + termcap.Normal,
584 if not CXX_version:
585 print termcap.Yellow + termcap.Bold + "COMMAND NOT FOUND!" +\
586 termcap.Normal
587 else:
588 print CXX_version.replace('\n', '<nl>')
600 print " If you're trying to use a compiler other than GCC, ICC, SunCC,"
589 print " If you're trying to use a compiler other than GCC"
601 print " or clang, there appears to be something wrong with your"
602 print " environment."
603 print " "
604 print " If you are trying to use a compiler other than those listed"
605 print " above you will need to ease fix SConstruct and "
606 print " src/SConscript to support that compiler."
607 Exit(1)
608

--- 577 unchanged lines hidden ---
590 print " or clang, there appears to be something wrong with your"
591 print " environment."
592 print " "
593 print " If you are trying to use a compiler other than those listed"
594 print " above you will need to ease fix SConstruct and "
595 print " src/SConscript to support that compiler."
596 Exit(1)
597

--- 577 unchanged lines hidden ---