summaryrefslogtreecommitdiffstats
path: root/src/engine
diff options
context:
space:
mode:
authorSteven Knight <knight@baldmt.com>2005-01-08 20:20:03 (GMT)
committerSteven Knight <knight@baldmt.com>2005-01-08 20:20:03 (GMT)
commit3c23f9969cea7931a8dea998a33b15ab51fe1a5f (patch)
treee473a43695378989d20058ce69b0c0b7d855a712 /src/engine
parenta30529bf7d9361a44490126666d0cc71d98410aa (diff)
downloadSCons-3c23f9969cea7931a8dea998a33b15ab51fe1a5f.zip
SCons-3c23f9969cea7931a8dea998a33b15ab51fe1a5f.tar.gz
SCons-3c23f9969cea7931a8dea998a33b15ab51fe1a5f.tar.bz2
Remove build engine dependencies on SCons.Script. Fix a misspelled variable name.
Diffstat (limited to 'src/engine')
-rw-r--r--src/engine/SCons/Environment.py2
-rw-r--r--src/engine/SCons/EnvironmentTests.py3
-rw-r--r--src/engine/SCons/SConf.py12
-rw-r--r--src/engine/SCons/SConfTests.py2
-rw-r--r--src/engine/SCons/Script/SConscript.py14
-rw-r--r--src/engine/SCons/Tool/__init__.py2
-rw-r--r--src/engine/SCons/Tool/aixc++.py3
7 files changed, 19 insertions, 19 deletions
diff --git a/src/engine/SCons/Environment.py b/src/engine/SCons/Environment.py
index c98c7aa..fbc8454 100644
--- a/src/engine/SCons/Environment.py
+++ b/src/engine/SCons/Environment.py
@@ -1188,7 +1188,7 @@ class Base(SubstitutionEnvironment):
if args:
nargs = nargs + self.subst_list(args)[0]
nkw = self.subst_kw(kw)
- nkw['called_from_env_method'] = 1
+ nkw['_depth'] = kw.get('_depth', 0) + 1
try:
nkw['custom_tests'] = self.subst_kw(nkw['custom_tests'])
except KeyError:
diff --git a/src/engine/SCons/EnvironmentTests.py b/src/engine/SCons/EnvironmentTests.py
index b34657a..ad5a9b2 100644
--- a/src/engine/SCons/EnvironmentTests.py
+++ b/src/engine/SCons/EnvironmentTests.py
@@ -2159,9 +2159,6 @@ f5: \
# Configure() will write to a local temporary file.
test = TestCmd.TestCmd(workdir = '')
save = os.getcwd()
- # Configure() will test, if we are reading a SConscript file
- import SCons.Script.SConscript
- SCons.Script.SConscript.sconscript_reading = 1
try:
os.chdir(test.workpath())
diff --git a/src/engine/SCons/SConf.py b/src/engine/SCons/SConf.py
index 76df30a..6b96384 100644
--- a/src/engine/SCons/SConf.py
+++ b/src/engine/SCons/SConf.py
@@ -326,17 +326,13 @@ class SConf:
"""
def __init__(self, env, custom_tests = {}, conf_dir='#/.sconf_temp',
- log_file='#/config.log', config_h = None,
- called_from_env_method = 0):
+ log_file='#/config.log', config_h = None, _depth = 0):
"""Constructor. Pass additional tests in the custom_tests-dictinary,
e.g. custom_tests={'CheckPrivate':MyPrivateTest}, where MyPrivateTest
defines a custom test.
Note also the conf_dir and log_file arguments (you may want to
build tests in the BuildDir, not in the SourceDir)
"""
- import SCons.Script.SConscript
- if not SCons.Script.SConscript.sconscript_reading:
- raise SCons.Errors.UserError, "Calling Configure from Builders is not supported."
global SConfFS
if not SConfFS:
SConfFS = SCons.Node.FS.FS(SCons.Node.FS.default_fs.pathTop)
@@ -350,7 +346,7 @@ class SConf:
self.logfile = None
self.logstream = None
self.lastTarget = None
- self.called_from_env_method = called_from_env_method
+ self.depth = _depth
self.cached = 0 # will be set, if all test results are cached
# add default tests
@@ -603,7 +599,7 @@ class SConf:
# existing file with the same name in the source directory
self.logfile.dir.add_ignore( [self.logfile] )
- tb = traceback.extract_stack()[-3-self.called_from_env_method]
+ tb = traceback.extract_stack()[-3-self.depth]
old_fs_dir = SConfFS.getcwd()
SConfFS.chdir(SConfFS.Top, change_os_dir=0)
self.logstream.write('file %s,line %d:\n\tConfigure(confdir = %s)\n' %
@@ -870,5 +866,3 @@ def CheckLibWithHeader(context, libs, header, language,
call = call, language = language, autoadd = autoadd)
context.did_show_result = 1
return not res
-
-
diff --git a/src/engine/SCons/SConfTests.py b/src/engine/SCons/SConfTests.py
index b704f62..3cde7d0 100644
--- a/src/engine/SCons/SConfTests.py
+++ b/src/engine/SCons/SConfTests.py
@@ -64,8 +64,6 @@ class SConfTestCase(unittest.TestCase):
# we only use SCons.Environment and SCons.SConf for these tests.
import SCons.Environment
import SCons.SConf
- import SCons.Script.SConscript
- SCons.Script.SConscript.sconscript_reading = 1
self.Environment = SCons.Environment
self.SConf = SCons.SConf
# and we need a new environment, cause references may point to
diff --git a/src/engine/SCons/Script/SConscript.py b/src/engine/SCons/Script/SConscript.py
index 4bc8bd3..30f6933 100644
--- a/src/engine/SCons/Script/SConscript.py
+++ b/src/engine/SCons/Script/SConscript.py
@@ -413,6 +413,12 @@ class SConsEnvironment(SCons.Environment.Base):
# as global functions.
#
+ def Configure(self, *args, **kw):
+ if not SCons.Script.SConscript.sconscript_reading:
+ raise SCons.Errors.UserError, "Calling Configure from Builders is not supported."
+ kw['_depth'] = kw.get('_depth', 0) + 1
+ return apply(SCons.Environment.Base.Configure, (self,)+args, kw)
+
def Default(self, *targets):
global DefaultCalled
global DefaultTargets
@@ -527,6 +533,12 @@ SCons.Environment.Environment = SConsEnvironment
def Options(files=None, args=Arguments):
return SCons.Options.Options(files, args)
+def Configure(*args, **kw):
+ if not SCons.Script.SConscript.sconscript_reading:
+ raise SCons.Errors.UserError, "Calling Configure from Builders is not supported."
+ kw['_depth'] = 1
+ return apply(SCons.SConf.SConf, args, kw)
+
#
_DefaultEnvironmentProxy = None
@@ -646,7 +658,7 @@ def BuildDefaultGlobals():
'Action' : SCons.Action.Action,
'BoolOption' : SCons.Options.BoolOption,
'Builder' : SCons.Builder.Builder,
- 'Configure' : SCons.SConf.SConf,
+ 'Configure' : Configure,
'EnumOption' : SCons.Options.EnumOption,
'Environment' : SCons.Environment.Environment,
'ListOption' : SCons.Options.ListOption,
diff --git a/src/engine/SCons/Tool/__init__.py b/src/engine/SCons/Tool/__init__.py
index 5513f5e..1cfe6ef 100644
--- a/src/engine/SCons/Tool/__init__.py
+++ b/src/engine/SCons/Tool/__init__.py
@@ -179,7 +179,7 @@ def createLoadableModuleBuilder(env):
"""
try:
- loadable_module = env['BUILDERS']['LoadableModule']
+ ld_module = env['BUILDERS']['LoadableModule']
except KeyError:
action_list = [ SCons.Defaults.SharedCheck,
SCons.Defaults.LdModuleLinkAction ]
diff --git a/src/engine/SCons/Tool/aixc++.py b/src/engine/SCons/Tool/aixc++.py
index dcc444a..91aa92e 100644
--- a/src/engine/SCons/Tool/aixc++.py
+++ b/src/engine/SCons/Tool/aixc++.py
@@ -36,7 +36,6 @@ __revision__ = "__FILE__ __REVISION__ __DATE__ __DEVELOPER__"
import os.path
import SCons.Platform.aix
-import SCons.Script.SConscript
cplusplus = __import__('c++', globals(), locals(), [])
@@ -48,7 +47,7 @@ def get_xlc(env):
return SCons.Platform.aix.get_xlc(env, xlc, xlc_r, packages)
def smart_cxxflags(source, target, env, for_signature):
- build_dir = SCons.Script.SConscript.GetBuildPath()
+ build_dir = env.GetBuildPath()
if build_dir:
return '-qtempinc=' + os.path.join(build_dir, 'tempinc')
return ''