Added PythonExtension wrapper method to scons.

This commit is contained in:
Sergey Popov 2008-07-14 16:53:20 +00:00
parent f6ec5f7529
commit 0b2292941d
2 changed files with 12 additions and 2 deletions

View file

@ -90,7 +90,7 @@ opts.AddOptions(
#
sys.path.insert(0, "./scons")
env = Environment(tools=["tar", "gettext", "install"], options = opts, toolpath = ["scons"])
env = Environment(tools=["tar", "gettext", "install", "python_devel"], options = opts, toolpath = ["scons"])
opts.Save('.scons-option-cache', env)

View file

@ -1,12 +1,22 @@
# vi: syntax=python:et:ts=4
import sys, os
from config_check_utils import *
import distutils.sysconfig
def exists():
return True
def PythonExtension(env, target, source, **kv):
return env.SharedLibrary(target, source, SHLIBPREFIX='', SHLIBSUFFIX=distutils.sysconfig.get_config_var("SO"), **kv)
def generate(env):
from SCons.Script.SConscript import SConsEnvironment
SConsEnvironment.PythonExtension = PythonExtension
def CheckPython(context):
env = context.env
backup = backup_env(env, ["CPPPATH", "LIBPATH", "LIBS"])
context.Message("Checking for Python... ")
import distutils.sysconfig
env.AppendUnique(CPPPATH = distutils.sysconfig.get_python_inc())
version = distutils.sysconfig.get_config_var("VERSION")
if not version: