Skip to content

Commit afc14d3

Browse files
committed
Make shared libraries relocatable.
1 parent bf27e8d commit afc14d3

File tree

5 files changed

+24
-4
lines changed

5 files changed

+24
-4
lines changed

Linux/makedist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ gitrepos=(
5656
master:v1.3.1
5757
libobjcryst
5858
https://github.com/diffpy/libobjcryst.git
59-
master:v2015.1.1
59+
master:5d0cdbca8c6c9fa86ddd7d82e51999456c36be2b
6060
diffpy.srreal
6161
https://github.com/diffpy/diffpy.srreal.git
6262
master:v1.1

Linux/src-addons/diffpy.srreal/sconscript.local

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
Import('env')
44

55
# Set RPATH to find the libdiffpy.so in the parent lib directory.
6-
env.AppendUnique(LINKFLAGS="-Wl,-rpath,'$$ORIGIN/../../../../..'")
6+
rpath_quoted = "'$$ORIGIN/../../../../..'"
7+
if env['PLATFORM'] == 'darwin':
8+
rpath_quoted = rpath_quoted.replace('$$ORIGIN', '@loader_path')
9+
env.Prepend(LINKFLAGS="-Wl,-rpath," + rpath_quoted)
710

811
# vim: ft=python

Linux/src-addons/libdiffpy/sconscript.local

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,13 @@ Import('env')
55

66
# Set RPATH to make the libdiffpy shared library search its
77
# own directory for other required shared libraries.
8-
env.AppendUnique(LINKFLAGS="-Wl,-rpath,'$$ORIGIN'")
8+
rpath_quoted = "'$$ORIGIN'"
9+
if env['PLATFORM'] == 'darwin':
10+
rpath_quoted = rpath_quoted.replace('$$ORIGIN', '@loader_path')
11+
env.Prepend(LINKFLAGS="-Wl,-rpath," + rpath_quoted)
12+
13+
if env['PLATFORM'] == 'darwin':
14+
env.Replace(DARWIN_INSTALL_NAME='@rpath/$TARGET.file')
915

1016
# determine installation path of the cxxtest framework
1117
env['CXXTEST_INSTALL_DIR'] = os.path.abspath(
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Local tweaks to the scons build environment.
2+
3+
Import('env')
4+
5+
if env['PLATFORM'] == 'darwin':
6+
env.Replace(DARWIN_INSTALL_NAME='@rpath/$TARGET.file')
7+
8+
# vim: ft=python

Linux/src-addons/pyobjcryst/sconscript.local

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
Import('env')
44

55
# Set RPATH to find the libObjCryst.so in the parent lib directory.
6-
env.AppendUnique(LINKFLAGS="-Wl,-rpath,'$$ORIGIN/../../../..'")
6+
rpath_quoted = "'$$ORIGIN/../../../..'"
7+
if env['PLATFORM'] == 'darwin':
8+
rpath_quoted = rpath_quoted.replace('$$ORIGIN', '@loader_path')
9+
env.Prepend(LINKFLAGS="-Wl,-rpath," + rpath_quoted)
710

811
# vim: ft=python

0 commit comments

Comments
 (0)