def generate(env):
    """
    Add builders and construction variables for the SwigGen builder.
    """
if 'SWIGCOM' not in env:
    raise SystemError('SCons build environment could not detect tool: swig')
bld = env.Builder(action=SwigGenAction, emitter=emitter, target_factory=env
    .fs.File)
env['BUILDERS']['SwigGen'] = bld
env['SWIGGENCOM'] = env['SWIGCOM']

def exists(env):
    return env.Detect('swig')
Using SCons as a build engine for distutils