summaryrefslogtreecommitdiff
path: root/source4/build
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-02-26 17:56:07 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-02-26 17:56:07 +0100
commitb3d2a56df29b163d93c4d20efc22c523441a92e5 (patch)
tree2e17a66d416d11d872527a98c23509d8ec4b5313 /source4/build
parentc5d77a1c2414d930ccbedbe05e124df69242a144 (diff)
downloadsamba-b3d2a56df29b163d93c4d20efc22c523441a92e5.tar.gz
samba-b3d2a56df29b163d93c4d20efc22c523441a92e5.tar.bz2
samba-b3d2a56df29b163d93c4d20efc22c523441a92e5.zip
Fix module aliases.
(This used to be commit 584a69acc5ccc0e9be0cb2687578c62bfa1e797d)
Diffstat (limited to 'source4/build')
-rw-r--r--source4/build/make/rules.mk11
-rw-r--r--source4/build/smb_build/makefile.pm19
2 files changed, 16 insertions, 14 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($$)