Deleted Added
sdiff udiff text old ( 6654:4c84e771cca7 ) new ( 6655:380a32b43336 )
full compact
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 ]
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',
125 '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
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
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...
389 main.Append(CCFLAGS=Split("-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 ---