Skip to content

Commit

Permalink
Fix os linking and loading problem (maybe on Z3Prover#4840).
Browse files Browse the repository at this point in the history
  • Loading branch information
arbipher committed Oct 25, 2021
1 parent ea5656c commit b1b5b55
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion scripts/mk_util.py
Original file line number Diff line number Diff line change
Expand Up @@ -2013,8 +2013,9 @@ def mk_makefile(self, out):
LIBZ3 = z3linkdep

LIBZ3 = LIBZ3 + ' ' + ' '.join(map(lambda x: '-cclib ' + x, LDFLAGS.split()))

stubs_install_path = '$$(%s printconf path)/stublibs' % OCAMLFIND
if not STATIC_LIB:
stubs_install_path = '$$(%s printconf path)/stublibs' % OCAMLFIND
loadpath = '-ccopt -L' + stubs_install_path
dllpath = '-dllpath ' + stubs_install_path
LIBZ3 = LIBZ3 + ' ' + loadpath + ' ' + dllpath
Expand All @@ -2038,6 +2039,9 @@ def mk_makefile(self, out):

out.write('\n')
out.write('ml: %s.cma %s.cmxa %s.cmxs\n' % (z3mls, z3mls, z3mls))
if IS_OSX:
out.write('\tinstall_name_tool -id libz3.dylib %s/libz3.dylib libz3.dylib\n' % (stubs_install_path))
out.write('\tinstall_name_tool -change libz3.dylib %s/libz3.dylib api/ml/dllz3ml.so\n' % (stubs_install_path))
out.write('\n')

if IS_WINDOWS:
Expand Down

0 comments on commit b1b5b55

Please sign in to comment.