Added wscript for building and installing with waf
authorDmitriy Morozov <dmitriy@mrzv.org>
Sat, 13 Jun 2009 16:48:38 -0700
changeset 3 242b36ad34e8
parent 2 cbe1fa5e2993
child 4 d88e548a9aeb
Added wscript for building and installing with waf
.hgignore
wscript
--- a/.hgignore	Fri Jun 12 18:08:50 2009 -0700
+++ b/.hgignore	Sat Jun 13 16:48:38 2009 -0700
@@ -1,3 +1,5 @@
 syntax: glob
 
 *.so
+build
+.lock-wscript
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/wscript	Sat Jun 13 16:48:38 2009 -0700
@@ -0,0 +1,30 @@
+#!/usr/bin/env python
+
+import Configure
+
+APPNAME     = 'pyANN'
+srcdir      = '.'
+blddir      = 'build'
+
+def set_options(opt):
+    opt.tool_options('compiler_cxx')
+    opt.tool_options('python')
+    opt.tool_options('boost')
+
+def configure(conf):
+    conf.check_tool('boost')
+    conf.check_tool('compiler_cxx')
+    conf.check_tool('python')
+    conf.check_python_version((2,6,0))
+    conf.check_python_headers()
+
+    conf.check(header_name = "ANN/ANN.h", mandatory = True)
+    conf.check(lib = 'ANN', mandatory = True)
+
+def build(bld):
+    bld.new_task_gen(features       = 'cxx cshlib pyext', 
+                     source         = 'ann-kd-tree.cpp pyann.cpp',
+                     target         = 'pyANN',
+                     cxxflags       = '-O3',
+                     lib            = ['ANN', 'boost_python'],
+                     install_path   = bld.env['PYTHONDIR'])