summaryrefslogtreecommitdiff
path: root/numpy
diff options
context:
space:
mode:
authorDavid Cournapeau <cournape@gmail.com>2008-05-20 08:17:27 +0000
committerDavid Cournapeau <cournape@gmail.com>2008-05-20 08:17:27 +0000
commit04b163d4a1c352562f1bb5988d5e267ea7bb08bd (patch)
treee903f045ecffba005de03724db5d648385b18735 /numpy
parentaa4bc9eb83d61f4c6bf62cf09c986ec11d8106df (diff)
downloadnumpy-04b163d4a1c352562f1bb5988d5e267ea7bb08bd.tar.gz
Current handling of bootstrapping is flawed: I should handle it at the
distutils level, not at the scons level. This is the first step to detect bootstrapping at distutils level, and pass its state to scons through command line.
Diffstat (limited to 'numpy')
-rw-r--r--numpy/distutils/command/scons.py17
1 files changed, 17 insertions, 0 deletions
diff --git a/numpy/distutils/command/scons.py b/numpy/distutils/command/scons.py
index 8ccce891c..ec52205cf 100644
--- a/numpy/distutils/command/scons.py
+++ b/numpy/distutils/command/scons.py
@@ -196,6 +196,15 @@ def select_packages(sconspkg, pkglist):
raise ValueError(msg)
return common
+def is_bootstrapping():
+ import __builtin__
+ try:
+ __builtin__.__NUMPY_SETUP__
+ return True
+ except AttributeError:
+ return False
+ __NUMPY_SETUP__ = False
+
class scons(old_build_ext):
# XXX: add an option to the scons command for configuration (auto/force/cache).
description = "Scons builder"
@@ -303,6 +312,8 @@ class scons(old_build_ext):
else:
# nothing to do, just leave it here.
return
+
+ print "is bootstrapping ? %s" % is_bootstrapping()
# XXX: when a scons script is missing, scons only prints warnings, and
# does not return a failure (status is 0). We have to detect this from
# distutils (this cannot work for recursive scons builds...)
@@ -326,6 +337,11 @@ class scons(old_build_ext):
post_hooks = self.post_hooks
pkg_names = self.pkg_names
+ if is_bootstrapping():
+ bootstrap = 1
+ else:
+ bootstrap = 0
+
for sconscript, pre_hook, post_hook, pkg_name in zip(sconscripts,
pre_hooks, post_hooks,
pkg_names):
@@ -364,6 +380,7 @@ class scons(old_build_ext):
elif int(self.silent) == 3:
cmd.append('-s')
cmd.append('silent=%d' % int(self.silent))
+ cmd.append('boostrapping=%d' % bootstrap)
cmdstr = ' '.join(cmd)
if int(self.silent) < 1:
log.info("Executing scons command (pkg is %s): %s ", pkg_name, cmdstr)