1# -*- mode:python -*- 2 3# Copyright (c) 2009 The Hewlett-Packard Development Company 4# Copyright (c) 2004-2005 The Regents of The University of Michigan 5# All rights reserved. 6# 7# Redistribution and use in source and binary forms, with or without 8# modification, are permitted provided that the following conditions are --- 97 unchanged lines hidden (view full) --- 106from os.path import abspath, basename, dirname, expanduser, normpath 107from os.path import exists, isdir, isfile 108from os.path import join as joinpath, split as splitpath 109 110# SCons includes 111import SCons 112import SCons.Node 113 |
114extra_python_paths = [ 115 Dir('src/python').srcnode().abspath, # M5 includes 116 Dir('ext/ply').srcnode().abspath, # ply is used by several files 117 ] 118 119sys.path[1:1] = extra_python_paths |
120 121from m5.util import compareVersions, readCommand 122 123######################################################################## 124# 125# Set up the main build environment. 126# 127######################################################################## 128use_vars = set([ 'AS', 'AR', 'CC', 'CXX', 'HOME', 'LD_LIBRARY_PATH', 'PATH', |
129 'PYTHONPATH', 'RANLIB' ]) |
130 131use_env = {} 132for key,val in os.environ.iteritems(): 133 if key in use_vars or key.startswith("M5"): 134 use_env[key] = val 135 136main = Environment(ENV=use_env) 137main.root = Dir(".") # The current directory (where this file lives). 138main.srcdir = Dir("src") # The source directory 139 |
140# add useful python code PYTHONPATH so it can be used by subprocesses 141# as well 142main.AppendENVPath('PYTHONPATH', extra_python_paths) 143 |
144######################################################################## 145# 146# Mercurial Stuff. 147# 148# If the M5 directory is a mercurial repository, we should do some 149# extra things. 150# 151######################################################################## --- 189 unchanged lines hidden (view full) --- 341 extras_dir_list = [] 342 343Export('base_dir') 344Export('extras_dir_list') 345 346# the ext directory should be on the #includes path 347main.Append(CPPPATH=[Dir('ext')]) 348 |
349CXX_version = readCommand([main['CXX'],'--version'], exception=False) 350CXX_V = readCommand([main['CXX'],'-V'], exception=False) 351 352main['GCC'] = CXX_version and CXX_version.find('g++') >= 0 353main['SUNCC'] = CXX_V and CXX_V.find('Sun C++') >= 0 354main['ICC'] = CXX_V and CXX_V.find('Intel') >= 0 355if main['GCC'] + main['SUNCC'] + main['ICC'] > 1: 356 print 'Error: How can we have two at the same time?' --- 29 unchanged lines hidden (view full) --- 386 main['CC'] = main['BATCH_CMD'] + ' ' + main['CC'] 387 main['CXX'] = main['BATCH_CMD'] + ' ' + main['CXX'] 388 main['AS'] = main['BATCH_CMD'] + ' ' + main['AS'] 389 main['AR'] = main['BATCH_CMD'] + ' ' + main['AR'] 390 main['RANLIB'] = main['BATCH_CMD'] + ' ' + main['RANLIB'] 391 392if sys.platform == 'cygwin': 393 # cygwin has some header file issues... |
394 main.Append(CCFLAGS="-Wno-uninitialized") |
395 396# Check for SWIG 397if not main.has_key('SWIG'): 398 print 'Error: SWIG utility not found.' 399 print ' Please install (see http://www.swig.org) and retry.' 400 Exit(1) 401 402# Check for appropriate SWIG version --- 469 unchanged lines hidden --- |