diff options
Diffstat (limited to 'src/python/setup.py')
-rw-r--r-- | src/python/setup.py | 64 |
1 files changed, 64 insertions, 0 deletions
diff --git a/src/python/setup.py b/src/python/setup.py new file mode 100644 index 00000000..abc07afa --- /dev/null +++ b/src/python/setup.py @@ -0,0 +1,64 @@ +import sys + +from distutils.core import setup, Extension +from distutils.sysconfig import get_config_vars +from distutils import util + +include_dirs = [ + '../aig/hop', + '../base/abc', + '../base/cmd', + '../base/io', + '../base/main', + '../bdd/cudd', + '../bdd/epd', + '../bdd/mtr', + '../misc/extra', + '../misc/nm', + '../misc/st', + '../misc/util', + '../misc/vec', + ] + +define_macros = [] +libraries = [] +library_dirs = [] + +if sys.platform == "win32": + + src_file = [ 'pyabc.i' ] + + define_macros.append( ('WIN32', 1) ) + define_macros.append( ('ABC_DLL', 'ABC_DLLEXPORT') ) + + libraries.append('abcr') + library_dirs.append('./../../lib') + +else: + + src_file = [ 'pyabc_wrap.c' ] + + if get_config_vars()['SIZEOF_VOID_P'] > 4: + define_macros.append( ('LIN64', 1) ) + else: + define_macros.append( ('LIN', 1) ) + + libraries.append( 'abc' ) + libraries.append( 'readline' ) + library_dirs.append('./../../') + +ext = Extension( + '_pyabc', + src_file, + define_macros=define_macros, + include_dirs = include_dirs, + library_dirs=library_dirs, + libraries=libraries + ) + +setup( + name='pyabc', + version='1.0', + ext_modules=[ext], + py_modules=['pyabc'] +) |