Skip to content

Commit

Permalink
quick fix for pip and python binding installation (keystone-engine#456)
Browse files Browse the repository at this point in the history
* quick fix for pip and python binding isntall

* better fix
  • Loading branch information
xwings authored May 7, 2020
1 parent 0a09dd1 commit 23b54ce
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions bindings/python/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,16 +121,12 @@ def build_libraries(self, libraries):
SETUP_DATA_FILES.append(PATH_LIB32)
return

# build library from source if src/ is existent
if not os.path.exists('src'):
return

try:
for (lib_name, build_info) in libraries:
log.info("building '%s' library", lib_name)

# cd src/build
os.chdir("src")
os.chdir("../..")
if not os.path.isdir('build'):
os.mkdir('build')
os.chdir("build")
Expand All @@ -146,10 +142,11 @@ def build_libraries(self, libraries):
else: # Unix
os.chmod("../make-share.sh", stat.S_IREAD | stat.S_IEXEC)
os.system("../make-share.sh lib_only")
base_dir = os.path.realpath(os.curdir)
if SYSTEM == "darwin":
SETUP_DATA_FILES.append("src/build/llvm/lib/libkeystone.dylib")
SETUP_DATA_FILES.append(base_dir + "/llvm/lib/libkeystone.dylib")
else: # Non-OSX
SETUP_DATA_FILES.append("src/build/llvm/lib/libkeystone.so")
SETUP_DATA_FILES.append(base_dir + "/llvm/lib/libkeystone.so")

# back to root dir
os.chdir(cur_dir)
Expand Down

0 comments on commit 23b54ce

Please sign in to comment.