SConstruct (6654:4c84e771cca7) SConstruct (6655:380a32b43336)
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
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
114# M5 includes
115sys.path[1:1] = [ Dir('src/python').srcnode().abspath ]
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
116
117from m5.util import compareVersions, readCommand
118
119########################################################################
120#
121# Set up the main build environment.
122#
123########################################################################
124use_vars = set([ 'AS', 'AR', 'CC', 'CXX', 'HOME', 'LD_LIBRARY_PATH', 'PATH',
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',
125 'RANLIB' ])
129 'PYTHONPATH', 'RANLIB' ])
126
127use_env = {}
128for key,val in os.environ.iteritems():
129 if key in use_vars or key.startswith("M5"):
130 use_env[key] = val
131
132main = Environment(ENV=use_env)
133main.root = Dir(".") # The current directory (where this file lives).
134main.srcdir = Dir("src") # The source directory
135
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
136########################################################################
137#
138# Mercurial Stuff.
139#
140# If the M5 directory is a mercurial repository, we should do some
141# extra things.
142#
143########################################################################

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

333 extras_dir_list = []
334
335Export('base_dir')
336Export('extras_dir_list')
337
338# the ext directory should be on the #includes path
339main.Append(CPPPATH=[Dir('ext')])
340
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
341# M5_PLY is used by isa_parser.py to find the PLY package.
342main.Append(ENV = { 'M5_PLY' : Dir('ext/ply').abspath })
343
344CXX_version = readCommand([main['CXX'],'--version'], exception=False)
345CXX_V = readCommand([main['CXX'],'-V'], exception=False)
346
347main['GCC'] = CXX_version and CXX_version.find('g++') >= 0
348main['SUNCC'] = CXX_V and CXX_V.find('Sun C++') >= 0
349main['ICC'] = CXX_V and CXX_V.find('Intel') >= 0
350if main['GCC'] + main['SUNCC'] + main['ICC'] > 1:
351 print 'Error: How can we have two at the same time?'

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

381 main['CC'] = main['BATCH_CMD'] + ' ' + main['CC']
382 main['CXX'] = main['BATCH_CMD'] + ' ' + main['CXX']
383 main['AS'] = main['BATCH_CMD'] + ' ' + main['AS']
384 main['AR'] = main['BATCH_CMD'] + ' ' + main['AR']
385 main['RANLIB'] = main['BATCH_CMD'] + ' ' + main['RANLIB']
386
387if sys.platform == 'cygwin':
388 # cygwin has some header file issues...
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...
389 main.Append(CCFLAGS=Split("-Wno-uninitialized"))
394 main.Append(CCFLAGS="-Wno-uninitialized")
390
391# Check for SWIG
392if not main.has_key('SWIG'):
393 print 'Error: SWIG utility not found.'
394 print ' Please install (see http://www.swig.org) and retry.'
395 Exit(1)
396
397# Check for appropriate SWIG version

--- 469 unchanged lines hidden ---
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 ---