Skip to content
Snippets Groups Projects
Commit 6bdf6eb1 authored by Mick Jordan's avatar Mick Jordan
Browse files

Merge pull request #376 in G/fastr from ~MICK.JORDAN_ORACLE.COM/fastr:feature/rpath to master

* commit '74331e52':
  use '$ORIGIN' for libR rpath on Linux
  mx copylib: ignore non-existent directories in PKG_LDFLAGS_OVERRIDE
  use rpath in preferece to loader_path in library shared objects
parents aec25ada 74331e52
Branches
No related tags found
No related merge requests found
......@@ -56,7 +56,7 @@ ifeq ($(OS_NAME),Darwin)
# check if we captured libpcre/libz, rpath those in libR
mx rupdatelib $(FASTR_LIB_DIR)
else
$(DYLIB_LD) $(DYLIB_LDFLAGS) -Wl,-rpath,$(FASTR_LIB_DIR) -o $(R_LIB) $(wildcard lib/*.o) -L$(FASTR_LIB_DIR) -lRblas -lRlapack -lpcre -lz
$(DYLIB_LD) $(DYLIB_LDFLAGS) -Wl,-rpath,'$$ORIGIN' -o $(R_LIB) $(wildcard lib/*.o) -L$(FASTR_LIB_DIR) -lRblas -lRlapack -lpcre -lz
endif
objs:
......
......@@ -109,7 +109,7 @@ $(LIB_PKG): $(C_OBJECTS) $(F_OBJECTS) $(GNUR_C_OBJECTS) $(GNUR_F_OBJECTS) $(PKGD
mkdir -p $(FASTR_LIBRARY_DIR)/$(PKG)/libs
cp $(LIB_PKG) $(FASTR_LIBRARY_DIR)/$(PKG)/libs
ifeq ($(OS_NAME),Darwin)
install_name_tool -id @loader_path/../library/$(PKG)/libs/$(PKG).so $(FASTR_LIBRARY_DIR)/$(PKG)/libs/$(PKG).so
install_name_tool -id @rpath/../library/$(PKG)/libs/$(PKG).so $(FASTR_LIBRARY_DIR)/$(PKG)/libs/$(PKG).so
endif
$(OBJ)/%.o: $(SRC)/%.c $(H_SOURCES)
......
......@@ -101,14 +101,15 @@ def copylib(args):
plain_libpath = lib_prefix + ext
for part in parts:
path = part.strip('"').lstrip('-L')
for f in os.listdir(path):
if f.startswith(lib_prefix):
if os.path.exists(os.path.join(path, plain_libpath)):
f = plain_libpath
target_dir = args[1]
if not os.path.exists(os.path.join(target_dir, f)):
_copylib(args[0], os.path.join(path, f), args[1])
return 0
if os.path.exists(path):
for f in os.listdir(path):
if f.startswith(lib_prefix):
if os.path.exists(os.path.join(path, plain_libpath)):
f = plain_libpath
target_dir = args[1]
if not os.path.exists(os.path.join(target_dir, f)):
_copylib(args[0], os.path.join(path, f), args[1])
return 0
mx.log(args[0] + ' not found in PKG_LDFLAGS_OVERRIDE, assuming system location')
......@@ -132,6 +133,8 @@ def updatelib(args):
cap_libs = []
libs = []
for lib in os.listdir(libdir):
if not '.dylib' in lib:
continue
if not os.path.islink(os.path.join(libdir, lib)):
libs.append(lib)
if ignorelib(lib) or os.path.islink(os.path.join(libdir, lib)):
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment