From a4b6992b7023d5b67428739c29aa9948d76fca21 Mon Sep 17 00:00:00 2001 From: Jelmer Vernooij Date: Sun, 9 Mar 2008 00:49:39 +0100 Subject: Move more code out of perl build system. (This used to be commit bfb4d847005567da43e93987add1a7b171b7b192) --- source4/build/make/rules.mk | 9 +++++++-- source4/build/smb_build/makefile.pm | 8 +++----- source4/build/smb_build/output.pm | 6 ++---- 3 files changed, 12 insertions(+), 11 deletions(-) (limited to 'source4/build') diff --git a/source4/build/make/rules.mk b/source4/build/make/rules.mk index 6ea187f376..3c4f4081ea 100644 --- a/source4/build/make/rules.mk +++ b/source4/build/make/rules.mk @@ -144,14 +144,19 @@ $(1): $(2) @mkdir -p $$(@D) @$$(SHLD) $$(LDFLAGS) $$(SHLD_FLAGS) $$(INTERN_LDFLAGS) -o $$@ $$(INSTALL_LINK_FLAGS) \ $(3) \ - $$(if $$(SONAMEFLAG), $$(SONAMEFLAG)$(4)) + $$(if $$(SONAMEFLAG), $$(SONAMEFLAG)$(notdir $(4))) -ifneq ($(notdir $(1)), $(notdir $(4))) +ifneq ($(notdir $(1)),$(notdir $(4))) $(4): $(1) @echo "Creating symbolic link for $(4)" @ln -fs $(notdir $(4)) $(1) endif +ifneq ($(notdir $(1)),$(notdir $(5))) +$(5): $(1) + @echo "Creating symbolic link for $(5)" + @ln -fs $(notdir $(5)) $(1) +endif endef # Shared alias diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index e420677e39..daf46655eb 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -137,9 +137,7 @@ sub SharedModule($$) if (defined($ctx->{ALIASES})) { - foreach (@{$ctx->{ALIASES}}) { - $self->output("\$(eval \$(call shared_module_alias_template,$ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME},$sane_subsystem,$_))\n"); - } + $self->output("\$(eval \$(foreach alias,". join(' ', @{$ctx->{ALIASES}}) . ",\$(call shared_module_alias_template,$ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME},$sane_subsystem,\$(alias))))\n"); } } @@ -157,12 +155,12 @@ sub SharedLibrary($$) { my ($self,$ctx) = @_; - $self->output("SHARED_LIBS += $ctx->{RESULT_SHARED_LIBRARY}\n") if (defined($ctx->{SO_VERSION})); + $self->output("SHARED_LIBS += $ctx->{RESULT_SHARED_LIBRARY}\n"); $self->_prepare_list($ctx, "DEPEND_LIST"); $self->_prepare_list($ctx, "LINK_FLAGS"); - $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"); + $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->{SHAREDDIR}/$ctx->{LIBRARY_SONAME},$ctx->{SHAREDDIR}/$ctx->{LIBRARY_DEBUGNAME}))\n"); } sub MergedObj($$) diff --git a/source4/build/smb_build/output.pm b/source4/build/smb_build/output.pm index 3dd3f0bda1..f9f12c3a73 100644 --- a/source4/build/smb_build/output.pm +++ b/source4/build/smb_build/output.pm @@ -47,10 +47,8 @@ sub generate_shared_library($) $lib->{LIBRARY_DEBUGNAME} = $lib->{LIBRARY_REALNAME}; - if (defined($lib->{VERSION})) { - $lib->{LIBRARY_SONAME} = "$lib->{LIBRARY_REALNAME}.\$($lib->{NAME}_SOVERSION)"; - $lib->{LIBRARY_REALNAME} = "$lib->{LIBRARY_REALNAME}.\$($lib->{NAME}_VERSION)"; - } + $lib->{LIBRARY_SONAME} = "\$(if \$($lib->{NAME}_SOVERSION),$lib->{LIBRARY_REALNAME}.\$($lib->{NAME}_SOVERSION),$lib->{LIBRARY_REALNAME})"; + $lib->{LIBRARY_REALNAME} = "\$(if \$($lib->{NAME}_VERSION),$lib->{LIBRARY_REALNAME}.\$($lib->{NAME}_VERSION),$lib->{LIBRARY_REALNAME})"; $lib->{RESULT_SHARED_LIBRARY} = "$lib->{SHAREDDIR}/$lib->{LIBRARY_REALNAME}"; $lib->{OUTPUT_SHARED_LIBRARY} = "-l$link_name"; -- cgit