python: temporary fix for cython

This commit is contained in:
Nguyen Anh Quynh 2014-01-08 18:05:34 +08:00
parent 99d365fd88
commit 4c259d4836
2 changed files with 43 additions and 38 deletions

View File

@ -102,12 +102,19 @@ CS_ERR_OPTION = 6 # Invalid/unsupported option: cs_option()
CS_ERR_DETAIL = 7 # Invalid/unsupported option: cs_option()
import ctypes, ctypes.util
from os.path import split, join
import ctypes, ctypes.util, sys
from os.path import split, join, dirname
import distutils.sysconfig
# load all the libs
#if getattr(sys, 'frozen', False):
# __file__ = dirname(sys.executable)
import inspect
if not hasattr(sys.modules[__name__], '__file__'):
__file__ = inspect.getfile(inspect.currentframe())
_lib_path = split(__file__)[0]
_all_libs = ['libcapstone.dll', 'libcapstone.so', 'libcapstone.dylib']
_found = False

View File

@ -1,36 +1,34 @@
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
VERSION = '2.0'
ext_modules = [ Extension("capstone", ["capstone/capstone.py"]),
Extension("capstone.arm", ["capstone/arm.py"]),
Extension("capstone.arm_const", ["capstone/arm_const.py"]),
Extension("capstone.arm64", ["capstone/arm64.py"]),
Extension("capstone.arm64_const", ["capstone/arm64_const.py"]),
Extension("capstone.mips", ["capstone/mips.py"]),
Extension("capstone.mips_const", ["capstone/mips_const.py"]),
Extension("capstone.ppc", ["capstone/ppc.py"]),
Extension("capstone.ppc_const", ["capstone/ppc_const.py"]),
Extension("capstone.x86", ["capstone/x86.py"]),
Extension("capstone.x86_const", ["capstone/x86_const.py"])
]
setup(
provides = ['capstone'],
packages = ['capstone'],
name = 'capstone',
version = VERSION,
cmdclass = {'build_ext': build_ext},
ext_modules = ext_modules,
author = 'Nguyen Anh Quynh',
author_email = 'aquynh@gmail.com',
description = 'Capstone disassembly engine',
url = 'http://www.capstone-engine.org',
classifiers = [
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 2',
],
)
from distutils.core import setup
from distutils.extension import Extension
from Cython.Distutils import build_ext
VERSION = '2.0'
ext_modules = [ Extension("capstone.capstone", ["capstone/capstone.py"]),
Extension("capstone.arm", ["capstone/arm.py"]),
Extension("capstone.arm_const", ["capstone/arm_const.py"]),
Extension("capstone.arm64", ["capstone/arm64.py"]),
Extension("capstone.arm64_const", ["capstone/arm64_const.py"]),
Extension("capstone.mips", ["capstone/mips.py"]),
Extension("capstone.mips_const", ["capstone/mips_const.py"]),
Extension("capstone.ppc", ["capstone/ppc.py"]),
Extension("capstone.ppc_const", ["capstone/ppc_const.py"]),
Extension("capstone.x86", ["capstone/x86.py"]),
Extension("capstone.x86_const", ["capstone/x86_const.py"])
]
setup(
provides = ['capstone'],
name = 'capstone',
version = VERSION,
cmdclass = {'build_ext': build_ext},
ext_modules = ext_modules,
author = 'Nguyen Anh Quynh',
author_email = 'aquynh@gmail.com',
description = 'Capstone disassembly engine',
url = 'http://www.capstone-engine.org',
classifiers = [
'License :: OSI Approved :: BSD License',
'Programming Language :: Python :: 2',
],
)