aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xconfigure.py4
-rw-r--r--src/build-data/makefile/gmake.in4
-rw-r--r--src/build-data/makefile/header.in4
-rw-r--r--src/build-data/makefile/nmake.in4
4 files changed, 10 insertions, 6 deletions
diff --git a/configure.py b/configure.py
index 963a1d3d0..888f9e71e 100755
--- a/configure.py
+++ b/configure.py
@@ -1283,7 +1283,9 @@ def create_template_vars(build_config, options, modules, cc, arch, osinfo):
# This can be made constistent over all platforms in the future
'libname': 'botan' if options.os == 'windows' else 'botan-%d.%d' % (build_config.version_major, build_config.version_minor),
- 'so_link': cc.so_link_command_for(osinfo.basename),
+ 'lib_link_cmd': cc.so_link_command_for(osinfo.basename),
+ 'app_link_cmd': '$(CXX) -Wl,-rpath=\$$ORIGIN' if options.os == 'linux' else '$(CXX)',
+ 'test_link_cmd': '$(CXX) -Wl,-rpath=\$$ORIGIN' if options.os == 'linux' else '$(CXX)',
'link_to': ' '.join([cc.add_lib_option + lib for lib in link_to()]),
diff --git a/src/build-data/makefile/gmake.in b/src/build-data/makefile/gmake.in
index dd2fa418d..af902c57b 100644
--- a/src/build-data/makefile/gmake.in
+++ b/src/build-data/makefile/gmake.in
@@ -34,10 +34,10 @@ all: $(APP) $(TEST)
%{gmake_dso_in}
$(APP): $(LIBRARIES) $(APPOBJS)
- $(CXX) $(LDFLAGS) $(APPOBJS) -L%{out_dir} -l%{libname} $(APP_LINKS_TO) -o $(APP)
+ $(APP_LINK_CMD) $(LDFLAGS) $(APPOBJS) -L%{out_dir} -l%{libname} $(APP_LINKS_TO) -o $(APP)
$(TEST): $(LIBRARIES) $(TESTOBJS)
- $(CXX) $(LDFLAGS) $(TESTOBJS) -L%{out_dir} -l%{libname} $(TEST_LINKS_TO) -o $(TEST)
+ $(TEST_LINK_CMD) $(LDFLAGS) $(TESTOBJS) -L%{out_dir} -l%{libname} $(TEST_LINKS_TO) -o $(TEST)
$(STATIC_LIB): $(LIBOBJS)
$(RM) $(STATIC_LIB)
diff --git a/src/build-data/makefile/header.in b/src/build-data/makefile/header.in
index d1a2ee3ef..dcc43592d 100644
--- a/src/build-data/makefile/header.in
+++ b/src/build-data/makefile/header.in
@@ -6,7 +6,9 @@ LANG_FLAGS = %{lang_flags}
WARN_FLAGS = %{warn_flags}
SO_OBJ_FLAGS = %{shared_flags}
-LIB_LINK_CMD = %{so_link}
+LIB_LINK_CMD = %{lib_link_cmd}
+APP_LINK_CMD = %{app_link_cmd}
+TEST_LINK_CMD = %{test_link_cmd}
LIB_LINKS_TO = %{link_to}
APP_LINKS_TO = $(LIB_LINKS_TO)
diff --git a/src/build-data/makefile/nmake.in b/src/build-data/makefile/nmake.in
index 6454e46ea..c89eb7f44 100644
--- a/src/build-data/makefile/nmake.in
+++ b/src/build-data/makefile/nmake.in
@@ -42,10 +42,10 @@ all: $(APP) $(TEST)
# Link Commands
$(APP): $(LIBRARIES) $(APPOBJS)
- $(CXX) /Fe$@ $(APPOBJS) $(LIB_FILENAME) $(APP_LINKS_TO)
+ $(APP_LINK_CMD) /Fe$@ $(APPOBJS) $(LIB_FILENAME) $(APP_LINKS_TO)
$(TEST): $(LIBRARIES) $(TESTOBJS)
- $(CXX) /Fe$@ $(TESTOBJS) $(LIB_FILENAME) $(TEST_LINKS_TO)
+ $(TEST_LINK_CMD) /Fe$@ $(TESTOBJS) $(LIB_FILENAME) $(TEST_LINKS_TO)
$(LIB_FILENAME): $(LIBOBJS)
!If "$(SO_OBJ_FLAGS)" == ""