.IP RPATH
A list of paths to search for shared libraries when running programs.
-Currently only used in the GNU linker. Ignored on platforms and
-toolchains that don't support it. Note that the paths added to RPATH
+Currently only used in the GNU linker (gnulink) and IRIX linker (sgilink).
+Ignored on platforms and toolchains that don't support it.
+Note that the paths added to RPATH
are not transformed by
.B scons
in any way: if you want an absolute
From Chad Austin and Christoph Wiedemann:
- Add support for a $RPATH variable to supply a list of directories
- to search for shared libraries when linking a program.
+ to search for shared libraries when linking a program. Used by
+ the GNU and IRIX linkers (gnulink and sgilink).
From Charles Crain:
env['LINK'] = env.Detect(linkers) or 'cc'
env['SHLINKFLAGS'] = SCons.Util.CLVar('$LINKFLAGS -shared')
+ # __RPATH is set to $_RPATH in the platform specification if that
+ # platform supports it.
+ env.Append(LINKFLAGS=['$__RPATH'])
+ env['RPATHPREFIX'] = '-rpath '
+ env['RPATHSUFFIX'] = ''
+ env['_RPATH'] = '${_concat(RPATHPREFIX, RPATH, RPATHSUFFIX, __env__)}'
+
def exists(env):
return env.Detect(linkers)