python bindings install target works. libhammer.so must be on LD_LIBRARY_PATH.

This commit is contained in:
Meredith L. Patterson 2013-11-26 19:54:09 -08:00
parent 20bf8c4b79
commit 79f498cdab
2 changed files with 11 additions and 19 deletions

View file

@ -1,22 +1,12 @@
# -*- python -*-
import os, os.path
Import('env libhammer_shared testruns')
Import('env libhammer_shared testruns targets')
pythonenv = env.Clone(IMPLICIT_COMMAND_DEPENDENCIES = 0)
#pythonenv.Append(CPPPATH = ['../../'])
#pythonenv.Append(CCFLAGS = ['-fpic', '-DSWIG', '-Wno-all', '-Wno-extra', '-Wno-error'])
#pythonenv.ParseConfig("pkg-config --cflags python")
#pythonenv.Append(LIBS = ['hammer'])
#pythonenv.Append(LIBPATH = ['../../'])
#pythonenv.Append(SWIGFLAGS = ['-DHAMMER_INTERNAL__NO_STDARG_H', '-Isrc/', '-python'])
swig = pythonenv.Command("hammer.i", "../swig/hammer.i", Copy("$TARGET", "$SOURCE"))
setup = ['setup.py']
pydir = os.path.join(env['BUILD_BASE'], 'src/bindings/python')
#libhammer_python = pythonenv.SharedLibrary('hammer', swig, SHLIBPREFIX='_')
libhammer_python = pythonenv.Command(['hammer.py', 'hammer_wrap.c'], [swig, setup], 'python ' + os.path.join(pydir, 'setup.py') + ' build_ext --inplace')
Default(libhammer_python)
@ -28,4 +18,6 @@ pytest = Alias("testpython", [pytestexec], pytestexec)
AlwaysBuild(pytest)
testruns.append(pytest)
pyinstallexec = pythonenv.Command(None, libhammer_python, 'python ' + os.path.join(pydir, 'setup.py ') + ' install')
pyinstall = Alias("installpython", [pyinstallexec], pyinstallexec)
targets.append(pyinstall)