2
0
mirror of https://github.com/boostorg/python.git synced 2026-01-27 19:12:16 +00:00

Move build system improvements

This commit is contained in:
Stefan Seefeld
2011-05-30 20:39:43 +00:00
parent daf466a697
commit 0a76801936
5 changed files with 30 additions and 50 deletions

View File

@@ -1,12 +1,10 @@
import python ;
import numpy ;
#import numpy ;
import regex ;
using python ;
libraries = ;
#How will the probe command be called ?
if [ python.configured ]
{
@@ -17,6 +15,20 @@ project boost/numpy
lib boost_python ;
rule numpy-includes ( properties * )
{
import feature ;
local python-interpreter = [ feature.get-values python.interpreter : $(properties) ] ;
if $(python-interpreter)
{
local full-cmd =
$(python-interpreter)" -c \"from numpy.distutils import misc_util; print ':'.join(misc_util.get_numpy_include_dirs())\" " ;
local output = [ SHELL $(full-cmd) ] ;
local includes = [ regex.split $(output) ":" ] ;
return <include>$(includes) ;
}
}
lib boost_numpy
: # sources
dtype.cpp
@@ -29,8 +41,11 @@ lib boost_numpy
<library>/python//python_for_extensions
#<library>/boost/python//boost_python
<library>boost_python
<conditional>@numpy-includes
: # default build
<link>shared
: # usage requirements
<conditional>@numpy-includes
;
libraries += boost_numpy ;

View File

@@ -1,18 +1,20 @@
import numpy ;
import testing ;
import python ;
use-project /boost/numpy : ../src ;
project /boost/numpy/test
: requirements
# Why isn't this provided by 'using python' ?
#<include>/usr/include/python2.7
;
project /boost/numpy/test ;
rule numpy-test ( name : sources * : requirements * )
{
sources ?= $(name).py $(name)_mod.cpp ;
return [ testing.make-test run-pyd : $(sources) /boost/numpy//boost_numpy
: $(requirements) : $(name) ] ;
}
test-suite numpy
:
[ numpy.numpy-test templates ]
[ numpy.numpy-test ufunc ]
[ numpy-test templates ]
[ numpy-test ufunc ]
;

View File

@@ -1,23 +0,0 @@
import testing ;
import python ;
rule init ( )
{
project.push-current $(.project) ;
debug-message Configuring numpy... ;
local full-cmd =
$(python.interpreter)" -c \"from numpy.distutils import misc_util; print misc_util.get_numpy_include_dirs()" ;
local output = [ shell-cmd $(full-cmd) ] ;
includes = $(output) ;
project.pop-current ;
}
rule numpy-test ( name : sources * : requirements * )
{
sources ?= $(name).py $(name)_mod.cpp ;
return [ testing.make-test run-pyd : $(sources) /boost/numpy//boost_numpy
: $(requirements) : $(name) ] ;
}

14
patch
View File

@@ -1,14 +0,0 @@
Index: SConscript
===================================================================
--- SConscript (revision 70774)
+++ SConscript (working copy)
@@ -10,7 +10,8 @@
)
bp_numpy_env = scons_tools.GetEnvironment().Clone()
bp_numpy_env.Append(CPPPATH=[os.path.abspath(os.curdir)])
-libpath = os.path.abspath("%s/python/numpy/src" % scons_tools.GetBuildDir())
+#libpath = os.path.abspath("%s/python/numpy/src" % scons_tools.GetBuildDir())
+libpath = os.path.abspath("libs/python/numpy/src")
if os.environ.has_key("LD_LIBRARY_PATH"):
bp_numpy_env["ENV"]["LD_LIBRARY_PATH"] = "%s:%s" % (libpath, os.environ["LD_LIBRARY_PATH"])
else: