--- a/bindings/python/capstone/__init__.py +++ b/bindings/python/capstone/__init__.py @@ -333,7 +333,7 @@ if sys.platform == 'darwin': _lib = "libcapstone.dylib" elif sys.platform in ('win32', 'cygwin'): - _lib = "capstone.dll" + _lib = "libcapstone.dll" else: _lib = "libcapstone.so" --- a/bindings/python/setup.py +++ b/bindings/python/setup.py @@ -65,8 +65,8 @@ LIBRARY_FILE = "libcapstone.dylib" STATIC_LIBRARY_FILE = 'libcapstone.a' elif SYSTEM in ('win32', 'cygwin'): - VERSIONED_LIBRARY_FILE = "capstone.dll" - LIBRARY_FILE = "capstone.dll" + VERSIONED_LIBRARY_FILE = "libcapstone.dll" + LIBRARY_FILE = "libcapstone.dll" STATIC_LIBRARY_FILE = None else: VERSIONED_LIBRARY_FILE = "libcapstone.so.{PKG_MAJOR}".format(**VERSION_DATA) @@ -165,7 +165,10 @@ class custom_build(build): def run(self): if 'LIBCAPSTONE_PATH' in os.environ: - log.info('Skipping building C extensions since LIBCAPSTONE_PATH is set') + log.info('Copying existing libcapstone to Python lib directory') + clean_bins() + os.mkdir(LIBS_DIR) + shutil.copy(os.environ['LIBCAPSTONE_PATH'], LIBS_DIR) else: log.info('Building C extensions') build_libraries()