Skip to content

Commit

Permalink
Fix MacOS rpath
Browse files Browse the repository at this point in the history
  • Loading branch information
johnkerl committed Oct 2, 2024
1 parent 321175a commit 814e802
Showing 1 changed file with 31 additions and 8 deletions.
39 changes: 31 additions & 8 deletions src/Makevars.in
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,38 @@ LIB_CON_DIR = ../inst/lib$(R_ARCH)
LIB_CON = $(LIB_CON_DIR)/libconnection@DYLIB_EXT@

all: $(OBJECTS) $(LIB_CON) $(SHLIB)
# if we are
# - on macOS aka Darwin which needs this
# - the library is present (implying non-system library use)
# then let us call install_name_tool
@if [ `uname -s` = 'Darwin' ] && [ -f ../inst/tiledb/lib/libtiledb.dylib ] && [ -f tiledb.so ]; then \
install_name_tool -change libz.1.dylib @rpath/libz.1.dylib ../inst/tiledb/lib/libtiledb.dylib; \
install_name_tool -add_rpath @loader_path/../tiledb/lib tiledb.so; \
install_name_tool -add_rpath @loader_path/../tiledb/lib $(LIB_CON); \
# On macOS aka Darwin we call install_name_tool
# Case one: If we had a downloaded TileDB Core artifact, adjust zlib path and add to @rpath
# Case two: If we see the system libraries (on macOS) ensure /usr/local/lib rpath is considered
echo HEYYYYYY
echo HEYYYYYY
echo HEYYYYYY
echo HEYYYYYY
echo HEYYYYYY
@if [ `uname -s` = 'Darwin' ] && [ -f tiledb.so ]; then \
if [ -f ../inst/tiledb/lib/libtiledb.dylib ] ; then \
install_name_tool -change libz.1.dylib @rpath/libz.1.dylib ../inst/tiledb/lib/libtiledb.dylib; \
install_name_tool -add_rpath @loader_path/../tiledb/lib tiledb.so; \
fi; \
if [ -f /usr/local/lib/libtiledb.dylib ] ; then \
install_name_tool -add_rpath /usr/local/lib tiledb.so; \
fi; \
fi
echo HEYYYYYY
echo HEYYYYYY
echo HEYYYYYY
echo HEYYYYYY
echo HEYYYYYY

# # if we are
# # - on macOS aka Darwin which needs this
# # - the library is present (implying non-system library use)
# # then let us call install_name_tool
# @if [ `uname -s` = 'Darwin' ] && [ -f ../inst/tiledb/lib/libtiledb.dylib ] && [ -f tiledb.so ]; then \
# install_name_tool -change libz.1.dylib @rpath/libz.1.dylib ../inst/tiledb/lib/libtiledb.dylib; \
# install_name_tool -add_rpath @loader_path/../tiledb/lib tiledb.so; \
# install_name_tool -add_rpath @loader_path/../tiledb/lib $(LIB_CON); \
# fi

$(LIB_CON): connection/connection.o
@mkdir -p $(LIB_CON_DIR)
Expand Down

0 comments on commit 814e802

Please sign in to comment.