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 --- 256 unchanged lines hidden (view full) --- 265 266min_swig_version = '1.3.28' 267if compare_versions(swig_version[2], min_swig_version) < 0: 268 print 'Error: SWIG version', min_swig_version, 'or newer required.' 269 print ' Installed version:', swig_version[2] 270 Exit(1) 271 272# Set up SWIG flags & scanner |
273swig_flags=Split('-c++ -python -modern -templatereduce $_CPPINCFLAGS') 274env.Append(SWIGFLAGS=swig_flags) |
275 |
276# filter out all existing swig scanners, they mess up the dependency 277# stuff for some reason 278scanners = [] 279for scanner in env['SCANNERS']: 280 skeys = scanner.skeys 281 if skeys == '.i': 282 continue 283 284 if isinstance(skeys, (list, tuple)) and '.i' in skeys: 285 continue |
286 |
287 scanners.append(scanner) 288 289# add the new swig scanner that we like better 290from SCons.Scanner import ClassicCPP as CPPScanner |
291swig_inc_re = '^[ \t]*[%,#][ \t]*(?:include|import)[ \t]*(<|")([^>"]+)(>|")' |
292scanners.append(CPPScanner("SwigScan", [ ".i" ], "CPPPATH", swig_inc_re)) |
293 |
294# replace the scanners list that has what we want 295env['SCANNERS'] = scanners |
296 |
297# Platform-specific configuration. Note again that we assume that all 298# builds under a given build root run on the same host platform. 299conf = Configure(env, 300 conf_dir = joinpath(build_root, '.scons_config'), 301 log_file = joinpath(build_root, 'scons_config.log')) 302 303# Find Python include and library directories for embedding the 304# interpreter. For consistency, we will use the same Python --- 386 unchanged lines hidden --- |