distutils being invoked from scons; ld is failing with 'libhammer.a: archive has no index, run ranlib to add one'
This commit is contained in:
parent
1e0f3744f8
commit
53bc886e2f
2 changed files with 27 additions and 17 deletions
|
|
@ -4,18 +4,20 @@ Import('env libhammer_shared testruns')
|
||||||
|
|
||||||
pythonenv = env.Clone(IMPLICIT_COMMAND_DEPENDENCIES = 0)
|
pythonenv = env.Clone(IMPLICIT_COMMAND_DEPENDENCIES = 0)
|
||||||
|
|
||||||
pythonenv.Append(CPPPATH = ['../../'])
|
#pythonenv.Append(CPPPATH = ['../../'])
|
||||||
pythonenv.Append(CCFLAGS = ['-fpic', '-DSWIG', '-Wno-all', '-Wno-extra', '-Wno-error'])
|
#pythonenv.Append(CCFLAGS = ['-fpic', '-DSWIG', '-Wno-all', '-Wno-extra', '-Wno-error'])
|
||||||
pythonenv.ParseConfig("pkg-config --cflags python")
|
#pythonenv.ParseConfig("pkg-config --cflags python")
|
||||||
pythonenv.Append(LIBS = ['hammer'])
|
#pythonenv.Append(LIBS = ['hammer'])
|
||||||
pythonenv.Append(LIBPATH = ['../../'])
|
#pythonenv.Append(LIBPATH = ['../../'])
|
||||||
pythonenv.Append(SWIGFLAGS = ['-DHAMMER_INTERNAL__NO_STDARG_H', '-Isrc/', '-python'])
|
#pythonenv.Append(SWIGFLAGS = ['-DHAMMER_INTERNAL__NO_STDARG_H', '-Isrc/', '-python'])
|
||||||
|
|
||||||
pythonenv.Command("hammer.i", "../swig/hammer.i", Copy("$TARGET", "$SOURCE"))
|
|
||||||
|
|
||||||
swig = ['hammer.i']
|
|
||||||
|
|
||||||
libhammer_python = pythonenv.SharedLibrary('hammer', swig, SHLIBPREFIX='_')
|
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(None, [swig, setup], 'python ' + os.path.join(pydir, 'setup.py') + ' build_ext --swig-opts="-outdir ' + pydir + ' -DHAMMER_INTERNAL__NO_STDARG_H -Isrc"')
|
||||||
Default(libhammer_python)
|
Default(libhammer_python)
|
||||||
|
|
||||||
pytestenv = pythonenv.Clone()
|
pytestenv = pythonenv.Clone()
|
||||||
|
|
|
||||||
|
|
@ -3,20 +3,28 @@
|
||||||
"""
|
"""
|
||||||
setup.py for Hammer bindings
|
setup.py for Hammer bindings
|
||||||
"""
|
"""
|
||||||
|
import os.path, sys
|
||||||
from distutils.core import setup, Extension
|
from distutils.core import setup, Extension
|
||||||
|
|
||||||
setup(name="hammer",
|
setup(name="hammer",
|
||||||
version="0.9.0",
|
version="0.9.0",
|
||||||
author="Upstanding Hackers, LLC",
|
author="Upstanding Hackers, LLC",
|
||||||
|
author_email="hammer@upstandinghackers.com",
|
||||||
|
url="https://github.com/UpstandingHackers/hammer",
|
||||||
description="""The Hammer parser combinator library""",
|
description="""The Hammer parser combinator library""",
|
||||||
ext_modules=[Extension('_hammer', ['hammer.i'],
|
ext_modules=[Extension('_hammer', [os.path.join(os.path.dirname(sys.argv[0]),
|
||||||
swig_opts=['-DHAMMER_INTERNAL__NO_STDARG_H', '-I../../'],
|
'hammer.i')],
|
||||||
define_macros = [('SWIG', None)],
|
# swig_opts is set by SConscript
|
||||||
extra_compile_args = ['-fPIC',
|
define_macros=[('SWIG', None)],
|
||||||
|
depends=['allocator.h',
|
||||||
|
'glue.h',
|
||||||
|
'hammer.h',
|
||||||
|
'internal.h',],
|
||||||
|
extra_compile_args=['-fPIC',
|
||||||
'-std=gnu99',],
|
'-std=gnu99',],
|
||||||
include_dirs=['../../'],
|
include_dirs=['src'],
|
||||||
library_dirs=['../../'],
|
library_dirs=['src'],
|
||||||
libraries=['hammer'],)],
|
libraries=['hammer'],)],
|
||||||
|
|
||||||
py_modules=['hammer'],
|
py_modules=['hammer'],
|
||||||
)
|
)
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue