summaryrefslogtreecommitdiff
path: root/source4/build
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2008-03-08 17:02:40 +0100
committerJelmer Vernooij <jelmer@samba.org>2008-03-08 17:02:40 +0100
commitfb6fdfce37a91021c346a52bd7d55a5ee576580a (patch)
treed57686ebd5a3217a83560e6f7c38d30d511203e7 /source4/build
parent2bf39edc9d0abf3306bd25b9c40d88aceb029be7 (diff)
downloadsamba-fb6fdfce37a91021c346a52bd7d55a5ee576580a.tar.gz
samba-fb6fdfce37a91021c346a52bd7d55a5ee576580a.tar.bz2
samba-fb6fdfce37a91021c346a52bd7d55a5ee576580a.zip
Fix the build.
(This used to be commit f2e49744717eb46bbfafeea9e2eb412a38a142e7)
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($$)