aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xconfigure.py7
-rw-r--r--src/build-data/makefile/gmake.in2
-rw-r--r--src/build-data/makefile/header.in3
-rw-r--r--src/build-data/makefile/nmake.in2
4 files changed, 14 insertions, 0 deletions
diff --git a/configure.py b/configure.py
index 888f9e71e..0d459bb66 100755
--- a/configure.py
+++ b/configure.py
@@ -1317,6 +1317,13 @@ def create_template_vars(build_config, options, modules, cc, arch, osinfo):
'with_sphinx': options.with_sphinx
}
+ if options.os == 'darwin':
+ vars['app_post_link_cmd'] = 'install_name_tool -change "/$(SONAME)" "@executable_path/$(SONAME)" $(APP)'
+ vars['test_post_link_cmd'] = 'install_name_tool -change "/$(SONAME)" "@executable_path/$(SONAME)" $(TEST)'
+ else:
+ vars['app_post_link_cmd'] = ''
+ vars['test_post_link_cmd'] = ''
+
gen_makefile_lists(vars, build_config, options, modules, cc, arch, osinfo)
if options.os != 'windows':
diff --git a/src/build-data/makefile/gmake.in b/src/build-data/makefile/gmake.in
index af902c57b..6b22a26f3 100644
--- a/src/build-data/makefile/gmake.in
+++ b/src/build-data/makefile/gmake.in
@@ -35,9 +35,11 @@ all: $(APP) $(TEST)
$(APP): $(LIBRARIES) $(APPOBJS)
$(APP_LINK_CMD) $(LDFLAGS) $(APPOBJS) -L%{out_dir} -l%{libname} $(APP_LINKS_TO) -o $(APP)
+ $(APP_POST_LINK_CMD)
$(TEST): $(LIBRARIES) $(TESTOBJS)
$(TEST_LINK_CMD) $(LDFLAGS) $(TESTOBJS) -L%{out_dir} -l%{libname} $(TEST_LINKS_TO) -o $(TEST)
+ $(TEST_POST_LINK_CMD)
$(STATIC_LIB): $(LIBOBJS)
$(RM) $(STATIC_LIB)
diff --git a/src/build-data/makefile/header.in b/src/build-data/makefile/header.in
index dcc43592d..b0e248ebe 100644
--- a/src/build-data/makefile/header.in
+++ b/src/build-data/makefile/header.in
@@ -19,3 +19,6 @@ APP_FLAGS = $(LANG_FLAGS) $(APP_OPT) $(WARN_FLAGS)
TEST_FLAGS = $(LANG_FLAGS) $(APP_OPT) $(WARN_FLAGS)
SCRIPTS_DIR = %{scripts_dir}
+
+APP_POST_LINK_CMD = %{app_post_link_cmd}
+TEST_POST_LINK_CMD = %{test_post_link_cmd}
diff --git a/src/build-data/makefile/nmake.in b/src/build-data/makefile/nmake.in
index c89eb7f44..9445063d9 100644
--- a/src/build-data/makefile/nmake.in
+++ b/src/build-data/makefile/nmake.in
@@ -43,9 +43,11 @@ all: $(APP) $(TEST)
# Link Commands
$(APP): $(LIBRARIES) $(APPOBJS)
$(APP_LINK_CMD) /Fe$@ $(APPOBJS) $(LIB_FILENAME) $(APP_LINKS_TO)
+ $(APP_POST_LINK_CMD)
$(TEST): $(LIBRARIES) $(TESTOBJS)
$(TEST_LINK_CMD) /Fe$@ $(TESTOBJS) $(LIB_FILENAME) $(TEST_LINKS_TO)
+ $(TEST_POST_LINK_CMD)
$(LIB_FILENAME): $(LIBOBJS)
!If "$(SO_OBJ_FLAGS)" == ""