summaryrefslogtreecommitdiff
path: root/numpy/lib/bscript
diff options
context:
space:
mode:
authorDavid Cournapeau <cournape@gmail.com>2011-03-15 11:39:15 -0400
committerDavid Cournapeau <cournape@gmail.com>2011-08-29 00:32:23 +0200
commitaa7e9bda76003fa4b9843de02b949d211a0c858c (patch)
tree40266281f3c10fc5ec3982a673f8a6bc0aa5b81c /numpy/lib/bscript
parent992b4a79e00f48ea85e7fa5d3413bda999b20918 (diff)
downloadnumpy-aa7e9bda76003fa4b9843de02b949d211a0c858c.tar.gz
FEAT: numpy.core and numpy.lib both build
Diffstat (limited to 'numpy/lib/bscript')
-rw-r--r--numpy/lib/bscript33
1 files changed, 33 insertions, 0 deletions
diff --git a/numpy/lib/bscript b/numpy/lib/bscript
new file mode 100644
index 000000000..03e36ce31
--- /dev/null
+++ b/numpy/lib/bscript
@@ -0,0 +1,33 @@
+import os
+
+from bento.commands.hooks \
+ import \
+ pre_build
+
+@pre_build()
+def pbuild(context):
+ bld = context.waf_context
+ # FIXME: bento command's context should have API so that subclasses can
+ # customize recurse behavior
+ # XXX: there is a risk of confusion between waf Node class and our own:
+ # mixing them is a big no no, and may cause very hard to debug issues.
+ # Find a solution
+ old_path = bld.path
+ bld.path = old_path.find_dir(context.local_node.path_from(context.top_node))
+ assert bld.path.__class__ == old_path.__class__
+
+ # FIXME: there has to be a better way to refer to numpy/core include
+ includes = [
+ os.path.join(bld.srcnode.path_from(bld.path), "numpy/core"),
+ os.path.join(bld.srcnode.path_from(bld.path), "numpy/core/include"),
+ os.path.join(bld.srcnode.path_from(bld.path), "numpy/core/include/numpy"),
+ os.path.join(bld.srcnode.path_from(bld.path), "numpy/core/src/private")]
+
+ def builder_compiled_base(bld, extension):
+ bld(features="c cshlib pyext",
+ target=extension.name,
+ includes=includes,
+ source=extension.sources)
+ context.register_builder("_compiled_base", builder_compiled_base)
+
+ bld.path = old_path