Skip to content

Commit 814e802

Browse files
committed
Fix MacOS rpath
1 parent 321175a commit 814e802

1 file changed

Lines changed: 31 additions & 8 deletions

File tree

src/Makevars.in

Lines changed: 31 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,38 @@ LIB_CON_DIR = ../inst/lib$(R_ARCH)
1111
LIB_CON = $(LIB_CON_DIR)/libconnection@DYLIB_EXT@
1212

1313
all: $(OBJECTS) $(LIB_CON) $(SHLIB)
14-
# if we are
15-
# - on macOS aka Darwin which needs this
16-
# - the library is present (implying non-system library use)
17-
# then let us call install_name_tool
18-
@if [ `uname -s` = 'Darwin' ] && [ -f ../inst/tiledb/lib/libtiledb.dylib ] && [ -f tiledb.so ]; then \
19-
install_name_tool -change libz.1.dylib @rpath/libz.1.dylib ../inst/tiledb/lib/libtiledb.dylib; \
20-
install_name_tool -add_rpath @loader_path/../tiledb/lib tiledb.so; \
21-
install_name_tool -add_rpath @loader_path/../tiledb/lib $(LIB_CON); \
14+
# On macOS aka Darwin we call install_name_tool
15+
# Case one: If we had a downloaded TileDB Core artifact, adjust zlib path and add to @rpath
16+
# Case two: If we see the system libraries (on macOS) ensure /usr/local/lib rpath is considered
17+
echo HEYYYYYY
18+
echo HEYYYYYY
19+
echo HEYYYYYY
20+
echo HEYYYYYY
21+
echo HEYYYYYY
22+
@if [ `uname -s` = 'Darwin' ] && [ -f tiledb.so ]; then \
23+
if [ -f ../inst/tiledb/lib/libtiledb.dylib ] ; then \
24+
install_name_tool -change libz.1.dylib @rpath/libz.1.dylib ../inst/tiledb/lib/libtiledb.dylib; \
25+
install_name_tool -add_rpath @loader_path/../tiledb/lib tiledb.so; \
26+
fi; \
27+
if [ -f /usr/local/lib/libtiledb.dylib ] ; then \
28+
install_name_tool -add_rpath /usr/local/lib tiledb.so; \
29+
fi; \
2230
fi
31+
echo HEYYYYYY
32+
echo HEYYYYYY
33+
echo HEYYYYYY
34+
echo HEYYYYYY
35+
echo HEYYYYYY
36+
37+
# # if we are
38+
# # - on macOS aka Darwin which needs this
39+
# # - the library is present (implying non-system library use)
40+
# # then let us call install_name_tool
41+
# @if [ `uname -s` = 'Darwin' ] && [ -f ../inst/tiledb/lib/libtiledb.dylib ] && [ -f tiledb.so ]; then \
42+
# install_name_tool -change libz.1.dylib @rpath/libz.1.dylib ../inst/tiledb/lib/libtiledb.dylib; \
43+
# install_name_tool -add_rpath @loader_path/../tiledb/lib tiledb.so; \
44+
# install_name_tool -add_rpath @loader_path/../tiledb/lib $(LIB_CON); \
45+
# fi
2346

2447
$(LIB_CON): connection/connection.o
2548
@mkdir -p $(LIB_CON_DIR)

0 commit comments

Comments
 (0)