summaryrefslogtreecommitdiff
path: root/source4
diff options
context:
space:
mode:
Diffstat (limited to 'source4')
-rw-r--r--source4/build/make/rules.mk11
-rw-r--r--source4/build/smb_build/makefile.pm19
-rw-r--r--source4/heimdal_build/config.mk4
3 files changed, 18 insertions, 16 deletions
diff --git a/source4/build/make/rules.mk b/source4/build/make/rules.mk
index bd72946593..794eed0f66 100644
--- a/source4/build/make/rules.mk
+++ b/source4/build/make/rules.mk
@@ -118,6 +118,17 @@ $(1): $(2) ;
@$$(PERL) $$(srcdir)/script/mkproto.pl --srcdir=$$(srcdir) --builddir=$$(builddir) --all=$$@ $$^
endef
+# Shared module
+# Arguments: Target, dependencies, objects
+define shared_module_template
+
+$(1): $(2) ;
+ @echo Linking $$@
+ @mkdir -p $$(@D)
+ @$$(MDLD) $$(LDFLAGS) $$(MDLD_FLAGS) $$(INTERN_LDFLAGS) -o $$@ $$(INSTALL_LINK_FLAGS) $(3)
+
+endef
+
###############################################################################
# File types
###############################################################################
diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm
index 3d7c73560d..9aa4e409bd 100644
--- a/source4/build/smb_build/makefile.pm
+++ b/source4/build/smb_build/makefile.pm
@@ -158,28 +158,19 @@ sub SharedModule($$)
$self->_prepare_list($ctx, "DEPEND_LIST");
$self->_prepare_list($ctx, "LINK_FLAGS");
- if (defined($ctx->{INIT_FUNCTION}) and $ctx->{TYPE} ne "PYTHON" and
- $ctx->{INIT_FUNCTION_TYPE} =~ /\(\*\)/) {
+ if (defined($ctx->{INIT_FUNCTION}) and $ctx->{INIT_FUNCTION_TYPE} =~ /\(\*\)/) {
$self->output("\$($ctx->{NAME}_OBJ_LIST): CFLAGS+=-D$ctx->{INIT_FUNCTION}=init_module\n");
}
- $self->output(<< "__EOD__"
-
-$ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME}: \$($ctx->{NAME}_DEPEND_LIST) \$($ctx->{NAME}_FULL_OBJ_LIST)
- \@echo Linking \$\@
- \@mkdir -p \$(\@D)
- \@\$(MDLD) \$(LDFLAGS) \$(MDLD_FLAGS) \$(INTERN_LDFLAGS) -o \$\@ \$(INSTALL_LINK_FLAGS) \\
- \$($ctx->{NAME}\_FULL_OBJ_LIST) \\
- \$($ctx->{NAME}_LINK_FLAGS)
-__EOD__
-);
+ $self->output("\$(eval \$(call shared_module_template,$ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME}, \$($ctx->{NAME}_DEPEND_LIST) \$($ctx->{NAME}_FULL_OBJ_LIST), \$($ctx->{NAME}\_FULL_OBJ_LIST) \$($ctx->{NAME}_LINK_FLAGS)))\n");
if (defined($ctx->{ALIASES})) {
foreach (@{$ctx->{ALIASES}}) {
- $self->output("\t\@ln -fs $ctx->{LIBRARY_REALNAME} $ctx->{SHAREDDIR}/$_.\$(SHLIBEXT)\n");
+ $self->output("$ctx->{SHAREDDIR}/$_.\$(SHLIBEXT): $ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME}\n");
+ $self->output("\t\@ln -fs \$(<F) \$@\n");
+ $self->output("PLUGINS += $ctx->{SHAREDDIR}/$_.\$(SHLIBEXT)\n");
}
}
- $self->output("\n");
}
sub SharedLibraryPrimitives($$)
diff --git a/source4/heimdal_build/config.mk b/source4/heimdal_build/config.mk
index b3e510da14..675c3cb0f1 100644
--- a/source4/heimdal_build/config.mk
+++ b/source4/heimdal_build/config.mk
@@ -474,7 +474,7 @@ OBJ_FILES = \
./heimdal/lib/asn1/symbol.ho \
./heimdal/lib/vers/print_version.ho \
./lib/socket_wrapper/socket_wrapper.ho \
- replace.ho
+ ./heimdal_build/replace.ho
PRIVATE_DEPENDENCIES = HEIMDAL_ASN1_COMPILE_LEX HEIMDAL_ROKEN_GETPROGNAME_H EXT_SOCKET EXT_NSL
# End BINARY asn1_compile
@@ -501,7 +501,7 @@ OBJ_FILES = ./heimdal/lib/vers/print_version.ho \
./heimdal/lib/roken/strupr.ho \
./heimdal/lib/roken/setprogname.ho \
./lib/socket_wrapper/socket_wrapper.ho \
- replace.ho
+ ./heimdal_build/replace.ho
PRIVATE_DEPENDENCIES = HEIMDAL_COM_ERR_COMPILE_LEX HEIMDAL_ROKEN_GETPROGNAME_H EXT_SOCKET EXT_NSL
# End BINARY compile_et
#######################