Deleted Added
sdiff udiff text old ( 10866:0421e52a57af ) new ( 10878:0e466ba12a99 )
full compact
1# -*- mode:python -*-
2
3# Copyright (c) 2013, 2015 ARM Limited
4# All rights reserved.
5#
6# The license below extends only to copyright in the software and shall
7# not be construed as granting a license to any other intellectual
8# property including but not limited to intellectual property relating

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

551# Set up default C++ compiler flags
552if main['GCC'] or main['CLANG']:
553 # As gcc and clang share many flags, do the common parts here
554 main.Append(CCFLAGS=['-pipe'])
555 main.Append(CCFLAGS=['-fno-strict-aliasing'])
556 # Enable -Wall and then disable the few warnings that we
557 # consistently violate
558 main.Append(CCFLAGS=['-Wall', '-Wno-sign-compare', '-Wundef'])
559 # We always compile using C++11
560 main.Append(CXXFLAGS=['-std=c++11'])
561 # Add selected sanity checks from -Wextra
562 main.Append(CXXFLAGS=['-Wmissing-field-initializers',
563 '-Woverloaded-virtual'])
564else:
565 print termcap.Yellow + termcap.Bold + 'Error' + termcap.Normal,
566 print "Don't know what compiler options to use for your compiler."
567 print termcap.Yellow + ' compiler:' + termcap.Normal, main['CXX']
568 print termcap.Yellow + ' version:' + termcap.Normal,

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

576 print " environment."
577 print " "
578 print " If you are trying to use a compiler other than those listed"
579 print " above you will need to ease fix SConstruct and "
580 print " src/SConscript to support that compiler."
581 Exit(1)
582
583if main['GCC']:
584 # Check for a supported version of gcc. >= 4.7 is chosen for its
585 # level of c++11 support. See
586 # http://gcc.gnu.org/projects/cxx0x.html for details.
587 gcc_version = readCommand([main['CXX'], '-dumpversion'], exception=False)
588 if compareVersions(gcc_version, "4.7") < 0:
589 print 'Error: gcc version 4.7 or newer required.'
590 print ' Installed version:', gcc_version
591 Exit(1)
592
593 main['GCC_VERSION'] = gcc_version
594
595 # gcc from version 4.8 and above generates "rep; ret" instructions
596 # to avoid performance penalties on certain AMD chips. Older
597 # assemblers detect this as an error, "Error: expecting string

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

635 # Use the same amount of jobs for LTO as we are running
636 # scons with
637 main['LTO_LDFLAGS'] = ['-flto=%d' % GetOption('num_jobs')]
638
639 main.Append(TCMALLOC_CCFLAGS=['-fno-builtin-malloc', '-fno-builtin-calloc',
640 '-fno-builtin-realloc', '-fno-builtin-free'])
641
642elif main['CLANG']:
643 # Check for a supported version of clang, >= 3.1 is needed to
644 # support similar features as gcc 4.7. See
645 # http://clang.llvm.org/cxx_status.html for details
646 clang_version_re = re.compile(".* version (\d+\.\d+)")
647 clang_version_match = clang_version_re.search(CXX_version)
648 if (clang_version_match):
649 clang_version = clang_version_match.groups()[0]
650 if compareVersions(clang_version, "3.1") < 0:
651 print 'Error: clang version 3.1 or newer required.'
652 print ' Installed version:', clang_version
653 Exit(1)
654 else:
655 print 'Error: Unable to determine clang version.'
656 Exit(1)
657
658 # clang has a few additional warnings that we disable,
659 # tautological comparisons are allowed due to unsigned integers

--- 775 unchanged lines hidden ---