about summary refs log tree commit diff
path: root/elf/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'elf/Makefile')
-rw-r--r--elf/Makefile10
1 files changed, 10 insertions, 0 deletions
diff --git a/elf/Makefile b/elf/Makefile
index 08288f89d5..a37e95d2c5 100644
--- a/elf/Makefile
+++ b/elf/Makefile
@@ -50,6 +50,16 @@ endif
 include ../Rules
 
 
+# Choose the default search path for the dynamic linker based on
+# where we will install libraries.
+ifneq ($(libdir),$(slibdir))
+default-rpath = $(slibdir):$(libdir)
+else
+default-rpath = $(libdir)
+endif
+CPPFLAGS += -DDEFAULT_RPATH='"$(default-rpath)"'
+
+
 # Link together the dynamic linker into a single relocatable object.
 # We use this to produce both the ABI-compliant and Linux-compatible
 # dynamic linker shared objects below.