Deleted Added
sdiff udiff text old ( 9239:c9f8a432e5ea ) new ( 9255:60f043573a65 )
full compact
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

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

679 asm(".globl _x; _x: .byte 0");
680 extern int x;
681 int main() { return x; }
682 ''', extension=".c")
683 context.env.Append(LEADING_UNDERSCORE=ret)
684 context.Result(ret)
685 return ret
686
687# Test for the presence of C++11 static asserts. If the compiler lacks
688# support for static asserts, base/compiler.hh enables a macro that
689# removes any static asserts in the code.
690def CheckStaticAssert(context):
691 context.Message("Checking for C++11 static_assert support...")
692 ret = context.TryCompile('''
693 static_assert(1, "This assert is always true");
694 ''', extension=".cc")
695 context.env.Append(HAVE_STATIC_ASSERT=ret)
696 context.Result(ret)
697 return ret
698
699# Platform-specific configuration. Note again that we assume that all
700# builds under a given build root run on the same host platform.
701conf = Configure(main,
702 conf_dir = joinpath(build_root, '.scons_config'),
703 log_file = joinpath(build_root, 'scons_config.log'),
704 custom_tests = { 'CheckLeading' : CheckLeading,
705 'CheckStaticAssert' : CheckStaticAssert,
706 })
707
708# Check for leading underscores. Don't really need to worry either
709# way so don't need to check the return code.
710conf.CheckLeading()
711
712# Check for C++11 features we want to use if they exist
713conf.CheckStaticAssert()
714
715# Check if we should compile a 64 bit binary on Mac OS X/Darwin
716try:
717 import platform
718 uname = platform.uname()
719 if uname[0] == 'Darwin' and compareVersions(uname[2], '9.0.0') >= 0:
720 if int(readCommand('sysctl -n hw.cpu64bit_capable')[0]):
721 main.Append(CCFLAGS=['-arch', 'x86_64'])
722 main.Append(CFLAGS=['-arch', 'x86_64'])

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

935 BoolVariable('CP_ANNOTATE', 'Enable critical path annotation capability', False),
936 EnumVariable('PROTOCOL', 'Coherence protocol for Ruby', 'None',
937 all_protocols),
938 )
939
940# These variables get exported to #defines in config/*.hh (see src/SConscript).
941export_vars += ['USE_FENV', 'SS_COMPATIBLE_FP',
942 'TARGET_ISA', 'CP_ANNOTATE', 'USE_POSIX_CLOCK', 'PROTOCOL',
943 'HAVE_STATIC_ASSERT']
944
945###################################################
946#
947# Define a SCons builder for configuration flag headers.
948#
949###################################################
950
951# This function generates a config header file that #defines the

--- 181 unchanged lines hidden ---