SConstruct (9239:c9f8a432e5ea) | SConstruct (9255:60f043573a65) |
---|---|
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 | 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 |
|
687# Platform-specific configuration. Note again that we assume that all 688# builds under a given build root run on the same host platform. 689conf = Configure(main, 690 conf_dir = joinpath(build_root, '.scons_config'), 691 log_file = joinpath(build_root, 'scons_config.log'), | 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'), |
692 custom_tests = { 'CheckLeading' : CheckLeading }) | 704 custom_tests = { 'CheckLeading' : CheckLeading, 705 'CheckStaticAssert' : CheckStaticAssert, 706 }) |
693 694# Check for leading underscores. Don't really need to worry either 695# way so don't need to check the return code. 696conf.CheckLeading() 697 | 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 |
|
698# Check if we should compile a 64 bit binary on Mac OS X/Darwin 699try: 700 import platform 701 uname = platform.uname() 702 if uname[0] == 'Darwin' and compareVersions(uname[2], '9.0.0') >= 0: 703 if int(readCommand('sysctl -n hw.cpu64bit_capable')[0]): 704 main.Append(CCFLAGS=['-arch', 'x86_64']) 705 main.Append(CFLAGS=['-arch', 'x86_64']) --- 212 unchanged lines hidden (view full) --- 918 BoolVariable('CP_ANNOTATE', 'Enable critical path annotation capability', False), 919 EnumVariable('PROTOCOL', 'Coherence protocol for Ruby', 'None', 920 all_protocols), 921 ) 922 923# These variables get exported to #defines in config/*.hh (see src/SConscript). 924export_vars += ['USE_FENV', 'SS_COMPATIBLE_FP', 925 'TARGET_ISA', 'CP_ANNOTATE', 'USE_POSIX_CLOCK', 'PROTOCOL', | 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', |
926 ] | 943 'HAVE_STATIC_ASSERT'] |
927 928################################################### 929# 930# Define a SCons builder for configuration flag headers. 931# 932################################################### 933 934# This function generates a config header file that #defines the --- 181 unchanged lines hidden --- | 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 --- |