SConstruct (3718:9d40568cfaeb) SConstruct (3918:1f9a98d198e8)
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

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

61# file), you can use 'scons -h' to print all the M5-specific build
62# options as well.
63#
64###################################################
65
66# Python library imports
67import sys
68import 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

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

61# file), you can use 'scons -h' to print all the M5-specific build
62# options as well.
63#
64###################################################
65
66# Python library imports
67import sys
68import os
69import subprocess
69from os.path import 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]".

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

201# I waffle on this setting... it does avoid a few painful but
202# unnecessary builds, but it also seems to make trivial builds take
203# noticeably longer.
204if False:
205 env.TargetSignatures('content')
206
207# M5_PLY is used by isa_parser.py to find the PLY package.
208env.Append(ENV = { 'M5_PLY' : Dir('ext/ply') })
70from os.path import 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]".

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

202# I waffle on this setting... it does avoid a few painful but
203# unnecessary builds, but it also seems to make trivial builds take
204# noticeably longer.
205if False:
206 env.TargetSignatures('content')
207
208# M5_PLY is used by isa_parser.py to find the PLY package.
209env.Append(ENV = { 'M5_PLY' : Dir('ext/ply') })
210env['GCC'] = False
211env['SUNCC'] = False
212env['GCC'] = subprocess.Popen(env['CXX'] + ' --version', shell=True,
213 stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
214 close_fds=True).communicate()[0].find('GCC') >= 0
215env['SUNCC'] = subprocess.Popen(env['CXX'] + ' -V', shell=True,
216 stdout=subprocess.PIPE, stderr=subprocess.STDOUT,
217 close_fds=True).communicate()[0].find('Sun C++') >= 0
218if (env['GCC'] and env['SUNCC']):
219 print 'Error: How can we have both g++ and Sun C++ at the same time?'
220 Exit(1)
209
221
222
210# Set up default C++ compiler flags
223# Set up default C++ compiler flags
211env.Append(CCFLAGS='-pipe')
212env.Append(CCFLAGS='-fno-strict-aliasing')
213env.Append(CCFLAGS=Split('-Wall -Wno-sign-compare -Werror -Wundef'))
224if env['GCC']:
225 env.Append(CCFLAGS='-pipe')
226 env.Append(CCFLAGS='-fno-strict-aliasing')
227 env.Append(CCFLAGS=Split('-Wall -Wno-sign-compare -Werror -Wundef'))
228elif env['SUNCC']:
229 env.Append(CCFLAGS='-Qoption ccfe')
230 env.Append(CCFLAGS='-features=gcc')
231 env.Append(CCFLAGS='-features=extensions')
232 env.Append(CCFLAGS='-library=stlport4')
233 env.Append(CCFLAGS='-xar')
234# env.Append(CCFLAGS='-instances=semiexplicit')
235else:
236 print 'Error: Don\'t know what compiler options to use for your compiler.'
237 print ' Please fix SConstruct and try again.'
238 Exit(1)
239
214if sys.platform == 'cygwin':
215 # cygwin has some header file issues...
216 env.Append(CCFLAGS=Split("-Wno-uninitialized"))
217env.Append(CPPPATH=[Dir('ext/dnet')])
218
219# Check for SWIG
220if not env.has_key('SWIG'):
221 print 'Error: SWIG utility not found.'

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

288# On Solaris you need to use libsocket for socket ops
289if not conf.CheckLibWithHeader(None, 'sys/socket.h', 'C++', 'accept(0,0,0);'):
290 if not conf.CheckLibWithHeader('socket', 'sys/socket.h', 'C++', 'accept(0,0,0);'):
291 print "Can't find library with socket calls (e.g. accept())"
292 Exit(1)
293
294# Check for zlib. If the check passes, libz will be automatically
295# added to the LIBS environment variable.
240if sys.platform == 'cygwin':
241 # cygwin has some header file issues...
242 env.Append(CCFLAGS=Split("-Wno-uninitialized"))
243env.Append(CPPPATH=[Dir('ext/dnet')])
244
245# Check for SWIG
246if not env.has_key('SWIG'):
247 print 'Error: SWIG utility not found.'

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

314# On Solaris you need to use libsocket for socket ops
315if not conf.CheckLibWithHeader(None, 'sys/socket.h', 'C++', 'accept(0,0,0);'):
316 if not conf.CheckLibWithHeader('socket', 'sys/socket.h', 'C++', 'accept(0,0,0);'):
317 print "Can't find library with socket calls (e.g. accept())"
318 Exit(1)
319
320# Check for zlib. If the check passes, libz will be automatically
321# added to the LIBS environment variable.
296if not conf.CheckLibWithHeader('z', 'zlib.h', 'C++'):
322if not conf.CheckLibWithHeader('z', 'zlib.h', 'C++','zlibVersion();'):
297 print 'Error: did not find needed zlib compression library '\
298 'and/or zlib.h header file.'
299 print ' Please install zlib and try again.'
300 Exit(1)
301
302# Check for <fenv.h> (C99 FP environment control)
303have_fenv = conf.CheckHeader('fenv.h', '<>')
304if not have_fenv:

--- 329 unchanged lines hidden ---
323 print 'Error: did not find needed zlib compression library '\
324 'and/or zlib.h header file.'
325 print ' Please install zlib and try again.'
326 Exit(1)
327
328# Check for <fenv.h> (C99 FP environment control)
329have_fenv = conf.CheckHeader('fenv.h', '<>')
330if not have_fenv:

--- 329 unchanged lines hidden ---