aboutsummaryrefslogtreecommitdiffstats
path: root/meson.build
diff options
context:
space:
mode:
authorLibravatar Arkadiusz Hiler <arek@hiler.eu>2018-09-30 15:11:24 +0300
committerLibravatar Arkadiusz Hiler <arek@hiler.eu>2018-09-30 15:37:01 +0300
commiteed0bc3ebd15bf94a28ca019ab656a3a0bc0d258 (patch)
tree63e09dad69399fe4470830b3103301a97ce0ab7f /meson.build
parentMerge pull request #2726 from RyanDwyer/overhaul-gaps (diff)
downloadsway-eed0bc3ebd15bf94a28ca019ab656a3a0bc0d258.tar.gz
sway-eed0bc3ebd15bf94a28ca019ab656a3a0bc0d258.tar.zst
sway-eed0bc3ebd15bf94a28ca019ab656a3a0bc0d258.zip
Add support for installing binaries with DT_RPATH
It's better to use DT_RPATH dynamic section of the elf binary to store the paths of libraries to load instead of overwriting LD_LIBRARY_PATH for the whole environment, causing surprises. This solution is much more transparent and perfectly suitable for running contained installations of wayland/wlroots/sway. The code unsetting the LD_LIBRARY_PATH/LD_PRELOAD was also deleted as it's a placebo security at best - we should trust the execution path that leads us to running sway, and it's way too late to care about those variables since we already started executing our compositor, thus we would be compromised anyway.
Diffstat (limited to 'meson.build')
-rw-r--r--meson.build11
1 files changed, 10 insertions, 1 deletions
diff --git a/meson.build b/meson.build
index 080709fa..1e7ce281 100644
--- a/meson.build
+++ b/meson.build
@@ -128,7 +128,16 @@ else
128endif 128endif
129add_project_arguments('-DSWAY_VERSION=@0@'.format(version), language: 'c') 129add_project_arguments('-DSWAY_VERSION=@0@'.format(version), language: 'c')
130 130
131add_project_arguments('-D_LD_LIBRARY_PATH="@0@"'.format(get_option('ld-library-path')), language: 'c') 131if get_option('use_rpath')
132 if get_option('custom_rpath') == ''
133 # default to platform specific libdir, one level up from the binary
134 rpathdir = join_paths('$ORIGIN', '..', '$LIB')
135 else
136 rpathdir = get_option('custom_rpath')
137 endif
138else
139 rpathdir = ''
140endif
132 141
133sway_inc = include_directories('include') 142sway_inc = include_directories('include')
134 143