SConstruct (5204:6c4fab6c1113) | SConstruct (5227:46118115ac3d) |
---|---|
1# -*- mode:python -*- 2 3# Copyright (c) 2004-2005 The Regents of The University of Michigan 4# All rights reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions are 8# met: redistributions of source code must retain the above copyright --- 51 unchanged lines hidden (view full) --- 60# 'm5' directory (or use -u or -C to tell scons where to find this 61# file), you can use 'scons -h' to print all the M5-specific build 62# options as well. 63# 64################################################### 65 66import sys 67import os | 1# -*- mode:python -*- 2 3# Copyright (c) 2004-2005 The Regents of The University of Michigan 4# All rights reserved. 5# 6# Redistribution and use in source and binary forms, with or without 7# modification, are permitted provided that the following conditions are 8# met: redistributions of source code must retain the above copyright --- 51 unchanged lines hidden (view full) --- 60# 'm5' directory (or use -u or -C to tell scons where to find this 61# file), you can use 'scons -h' to print all the M5-specific build 62# options as well. 63# 64################################################### 65 66import sys 67import os |
68import subprocess | |
69 70from os.path import isdir, join as joinpath 71 72# Check for recent-enough Python and SCons versions. If your system's 73# default installation of Python is not recent enough, you can use a 74# non-default installation of the Python interpreter by either (1) 75# rearranging your PATH so that scons finds the non-default 'python' 76# first or (2) explicitly invoking an alternative interpreter on the 77# scons script, e.g., "/usr/local/bin/python2.4 `which scons` [args]". 78EnsurePythonVersion(2,4) 79 | 68 69from os.path import isdir, join as joinpath 70 71# Check for recent-enough Python and SCons versions. If your system's 72# default installation of Python is not recent enough, you can use a 73# non-default installation of the Python interpreter by either (1) 74# rearranging your PATH so that scons finds the non-default 'python' 75# first or (2) explicitly invoking an alternative interpreter on the 76# scons script, e.g., "/usr/local/bin/python2.4 `which scons` [args]". 77EnsurePythonVersion(2,4) 78 |
79# Import subprocess after we check the version since it doesn't exist in 80# Python < 2.4. 81import subprocess 82 |
|
80# Ironically, SCons 0.96 dies if you give EnsureSconsVersion a 81# 3-element version number. 82min_scons_version = (0,96,91) 83try: 84 EnsureSConsVersion(*min_scons_version) 85except: 86 print "Error checking current SCons version." 87 print "SCons", ".".join(map(str,min_scons_version)), "or greater required." --- 236 unchanged lines hidden (view full) --- 324env['SCANNERS'] = scanners 325 326# Platform-specific configuration. Note again that we assume that all 327# builds under a given build root run on the same host platform. 328conf = Configure(env, 329 conf_dir = joinpath(build_root, '.scons_config'), 330 log_file = joinpath(build_root, 'scons_config.log')) 331 | 83# Ironically, SCons 0.96 dies if you give EnsureSconsVersion a 84# 3-element version number. 85min_scons_version = (0,96,91) 86try: 87 EnsureSConsVersion(*min_scons_version) 88except: 89 print "Error checking current SCons version." 90 print "SCons", ".".join(map(str,min_scons_version)), "or greater required." --- 236 unchanged lines hidden (view full) --- 327env['SCANNERS'] = scanners 328 329# Platform-specific configuration. Note again that we assume that all 330# builds under a given build root run on the same host platform. 331conf = Configure(env, 332 conf_dir = joinpath(build_root, '.scons_config'), 333 log_file = joinpath(build_root, 'scons_config.log')) 334 |
335# Check if we should compile a 64 bit binary on Mac OS X/Darwin 336try: 337 import platform 338 uname = platform.uname() 339 if uname[0] == 'Darwin' and compare_versions(uname[2], '9.0.0') >= 0: 340 if int(subprocess.Popen('sysctl -n hw.cpu64bit_capable', shell=True, 341 stdout=subprocess.PIPE, stderr=subprocess.STDOUT, 342 close_fds=True).communicate()[0][0]): 343 env.Append(CCFLAGS='-arch x86_64') 344 env.Append(CFLAGS='-arch x86_64') 345 env.Append(LINKFLAGS='-arch x86_64') 346 env.Append(ASFLAGS='-arch x86_64') 347except: 348 pass 349 |
|
332# Recent versions of scons substitute a "Null" object for Configure() 333# when configuration isn't necessary, e.g., if the "--help" option is 334# present. Unfortuantely this Null object always returns false, 335# breaking all our configuration checks. We replace it with our own 336# more optimistic null object that returns True instead. 337if not conf: 338 def NullCheck(*args, **kwargs): 339 return True --- 412 unchanged lines hidden --- | 350# Recent versions of scons substitute a "Null" object for Configure() 351# when configuration isn't necessary, e.g., if the "--help" option is 352# present. Unfortuantely this Null object always returns false, 353# breaking all our configuration checks. We replace it with our own 354# more optimistic null object that returns True instead. 355if not conf: 356 def NullCheck(*args, **kwargs): 357 return True --- 412 unchanged lines hidden --- |