summaryrefslogtreecommitdiff
path: root/source4/build
diff options
context:
space:
mode:
Diffstat (limited to 'source4/build')
-rw-r--r--source4/build/make/rules.mk18
-rw-r--r--source4/build/smb_build/makefile.pm16
2 files changed, 19 insertions, 15 deletions
diff --git a/source4/build/make/rules.mk b/source4/build/make/rules.mk
index d7482fe45c..3c195e2903 100644
--- a/source4/build/make/rules.mk
+++ b/source4/build/make/rules.mk
@@ -136,6 +136,24 @@ $(1): $(2) ;
endef
+# Shared library
+# Arguments: Target, dependencies, link flags, soname
+define shared_library_template
+$(1): $(2)
+ @echo Linking $$@
+ @mkdir -p $$(@D)
+ @$$(SHLD) $$(LDFLAGS) $$(SHLD_FLAGS) $$(INTERN_LDFLAGS) -o $$@ $$(INSTALL_LINK_FLAGS) \
+ $(3) \
+ $$(if $$(SONAMEFLAG), $$(SONAMEFLAG)$(4))
+
+ifneq ($(notdir $(1)), $(notdir $(4)))
+$(4): $(1)
+ @echo "Creating symbolic link for $(4)"
+ @ln -fs $(notdir $(4)) $(1)
+endif
+
+endef
+
# Shared alias
# Arguments: Target, subsystem name, alias name
define shared_module_alias_template
diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm
index 2a4621de30..e420677e39 100644
--- a/source4/build/smb_build/makefile.pm
+++ b/source4/build/smb_build/makefile.pm
@@ -162,21 +162,7 @@ sub SharedLibrary($$)
$self->_prepare_list($ctx, "DEPEND_LIST");
$self->_prepare_list($ctx, "LINK_FLAGS");
- $self->output(<< "__EOD__"
-$ctx->{RESULT_SHARED_LIBRARY}: \$($ctx->{NAME}_DEPEND_LIST) \$($ctx->{NAME}_FULL_OBJ_LIST)
- \@echo Linking \$\@
- \@mkdir -p \$(\@D)
- \@\$(SHLD) \$(LDFLAGS) \$(SHLD_FLAGS) \$(INTERN_LDFLAGS) -o \$\@ \$(INSTALL_LINK_FLAGS) \\
- \$($ctx->{NAME}\_FULL_OBJ_LIST) \$($ctx->{NAME}_LINK_FLAGS) \\
- \$(if \$(SONAMEFLAG), \$(SONAMEFLAG)$ctx->{LIBRARY_SONAME})
-ifneq ($ctx->{LIBRARY_REALNAME}, $ctx->{LIBRARY_SONAME})
- \@test \$($ctx->{NAME}_VERSION) = \$($ctx->{NAME}_SOVERSION) || ln -fs $ctx->{LIBRARY_REALNAME} $ctx->{SHAREDDIR}/$ctx->{LIBRARY_SONAME}
-endif
-ifdef $ctx->{NAME}_SOVERSION
- \@ln -fs $ctx->{LIBRARY_REALNAME} $ctx->{SHAREDDIR}/$ctx->{LIBRARY_DEBUGNAME}
-endif
-__EOD__
-);
+ $self->output("\$(eval \$(call shared_library_template,$ctx->{RESULT_SHARED_LIBRARY}, \$($ctx->{NAME}_DEPEND_LIST) \$($ctx->{NAME}_FULL_OBJ_LIST), \$($ctx->{NAME}\_FULL_OBJ_LIST) \$($ctx->{NAME}_LINK_FLAGS),$ctx->{LIBRARY_SONAME}))\n");
}
sub MergedObj($$)