Commit 306da846 authored by Celine Mercier's avatar Celine Mercier

obidistutils: link obi3 C shared library instead of compiling all C

files with all modules (creating issues with global/static variables).
EXCEPT RUNTIME LINKING DOESN'T WORK YET
parent af57e532
......@@ -47,10 +47,16 @@ def findCython(root,base=None,pyrexs=None):
for module in (path.basename(path.dirname(x))
for x in glob.glob(path.join(root,'*','__init__.py'))):
for pyrex in glob.glob(path.join(root,module,'*.pyx')):
libabspath = os.path.abspath('obi_libdir')
obiabspath = os.path.abspath('.')
pyrexs.append(Extension('.'.join(base+[module,path.splitext(path.basename(pyrex))[0]]),
[pyrex]
[pyrex],
library_dirs=[libabspath],
include_dirs=[libabspath],
libraries=["obi3"],
runtime_library_dirs=[libabspath],
extra_link_args=["-Wl,-rpath,"+libabspath, "-R"+libabspath]
)
)
try:
......@@ -63,13 +69,14 @@ def findCython(root,base=None,pyrexs=None):
log.info("Cython module : %s",cfiles)
incdir = set(os.path.dirname(x) for x in cfiles if x[-2:]==".h")
cfiles = [x for x in cfiles if x[-2:]==".c"]
pyrexs[-1].sources.extend(cfiles)
#cfiles = [x for x in cfiles if x[-2:]==".c"]
#pyrexs[-1].sources.extend(cfiles)
pyrexs[-1].include_dirs.extend(incdir)
pyrexs[-1].extra_compile_args.extend(['-msse2',
'-Wno-unused-function',
'-Wmissing-braces',
'-Wchar-subscripts'])
'-Wchar-subscripts'
])
except IOError:
pass
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment