Deleted Added
sdiff udiff text old ( 3049:2f90320192d3 ) new ( 3053:b0c9652cf9b9 )
full compact
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

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

114
115# helper function: find last occurrence of element in list
116def rfind(l, elt, offs = -1):
117 for i in range(len(l)+offs, 0, -1):
118 if l[i] == elt:
119 return i
120 raise ValueError, "element not found"
121
122# Each target must have 'build' in the interior of the path; the
123# directory below this will determine the build parameters. For
124# example, for target 'foo/bar/build/ALPHA_SE/arch/alpha/blah.do' we
125# recognize that ALPHA_SE specifies the configuration because it
126# follow 'build' in the bulid path.
127
128# Generate a list of the unique build roots and configs that the
129# collected targets reference.

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

197
198# include path, e.g. /usr/local/include/python2.4
199env.Append(CPPPATH = os.path.join(sys.exec_prefix, 'include', py_version_name))
200env.Append(LIBS = py_version_name)
201# add library path too if it's not in the default place
202if sys.exec_prefix != '/usr':
203 env.Append(LIBPATH = os.path.join(sys.exec_prefix, 'lib'))
204
205# Set up SWIG flags & scanner
206
207env.Append(SWIGFLAGS=Split('-c++ -python -modern $_CPPINCFLAGS'))
208
209import SCons.Scanner
210
211swig_inc_re = '^[ \t]*[%,#][ \t]*(?:include|import)[ \t]*(<|")([^>"]+)(>|")'
212
213swig_scanner = SCons.Scanner.ClassicCPP("SwigScan", ".i", "CPPPATH",
214 swig_inc_re)
215
216env.Append(SCANNERS = swig_scanner)
217
218# Other default libraries
219env.Append(LIBS=['z'])
220
221# Platform-specific configuration. Note again that we assume that all
222# builds under a given build root run on the same host platform.
223conf = Configure(env,
224 conf_dir = os.path.join(build_root, '.scons_config'),
225 log_file = os.path.join(build_root, 'scons_config.log'))
226
227# Check for <fenv.h> (C99 FP environment control)
228have_fenv = conf.CheckHeader('fenv.h', '<>')
229if not have_fenv:
230 print "Warning: Header file <fenv.h> not found."
231 print " This host has no IEEE FP rounding mode control."
232
233# Check for mysql.
234mysql_config = WhereIs('mysql_config')
235have_mysql = mysql_config != None
236
237# Check MySQL version.
238if have_mysql:
239 mysql_version = os.popen(mysql_config + ' --version').read()
240 mysql_version = mysql_version.split('.')
241 mysql_major = int(mysql_version[0])
242 mysql_minor = int(mysql_version[1])
243 # This version check is probably overly conservative, but it deals
244 # with the versions we have installed.
245 if mysql_major < 4 or (mysql_major == 4 and mysql_minor < 1):
246 print "Warning: MySQL v4.1 or newer required."
247 have_mysql = False
248
249# Set up mysql_config commands.
250if have_mysql:
251 mysql_config_include = mysql_config + ' --include'
252 if os.system(mysql_config_include + ' > /dev/null') != 0:
253 # older mysql_config versions don't support --include, use
254 # --cflags instead

--- 256 unchanged lines hidden ---