From 04af4d0cc3c38d9de38fb21cbbfb9e19f28c7ea9 Mon Sep 17 00:00:00 2001 From: Stefan Metzmacher Date: Tue, 7 Mar 2006 14:00:57 +0000 Subject: r13940: use the local vs. install linkerflag trick for shared libs too metze (This used to be commit 65bb303ff3815cc11e07061d478e317ffb24d453) --- source4/build/smb_build/makefile.pm | 49 ++++++++++++++++++++++++++++++++----- 1 file changed, 43 insertions(+), 6 deletions(-) (limited to 'source4/build') diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm index 0feabd8ac9..5abc03d350 100644 --- a/source4/build/smb_build/makefile.pm +++ b/source4/build/smb_build/makefile.pm @@ -119,11 +119,12 @@ CFLAGS=-I\$(srcdir)/include -I\$(srcdir) -I\$(srcdir)/lib -D_SAMBA_BUILD_ -DHAVE PICFLAG=$self->{config}->{PICFLAG} HOSTCC=$self->{config}->{HOSTCC} -LD=$self->{config}->{LD} -LDFLAGS=$self->{config}->{LDFLAGS} -L\$(builddir)/bin LOCAL_LINK_FLAGS=$devld_local INSTALL_LINK_FLAGS=$devld_install +LD=$self->{config}->{LD} +LDFLAGS=$self->{config}->{LDFLAGS} -L\$(builddir)/bin + STLD=$self->{config}->{AR} STLD_FLAGS=-rc -L\$(builddir)/bin @@ -255,6 +256,14 @@ sub SharedLibrary($$) { my ($self,$ctx) = @_; + my $installdir; + + if ($self->{duplicate_build}) { + $installdir = "bin/install"; + } else { + $installdir = "bin"; + } + push (@{$self->{shared_libs}}, "bin/$ctx->{LIBRARY_REALNAME}"); push (@{$self->{shared_modules}}, "bin/$ctx->{LIBRARY_REALNAME}"); @@ -270,19 +279,20 @@ sub SharedLibrary($$) push(@{$self->{proto_objs}}, "\$($ctx->{TYPE}_$ctx->{NAME}_OBJ_LIST\)"); } - $self->output(<< "__EOD__" + if ($self->{duplicate_build}) { + $self->output(<< "__EOD__" # bin/$ctx->{LIBRARY_REALNAME}: \$($ctx->{TYPE}_$ctx->{NAME}_DEPEND_LIST) \$($ctx->{TYPE}_$ctx->{NAME}_OBJ_LIST) \@echo Linking \$\@ - \@\$(SHLD) \$(SHLD_FLAGS) -o \$\@ \\ + \@\$(SHLD) \$(SHLD_FLAGS) -o \$\@ \$(LOCAL_LINK_FLAGS) \\ \$($ctx->{TYPE}_$ctx->{NAME}_LINK_FLAGS) \\ \$($ctx->{TYPE}_$ctx->{NAME}_LINK_LIST) __EOD__ ); - if (defined($ctx->{LIBRARY_SONAME})) { - $self->output(<< "__EOD__" + if (defined($ctx->{LIBRARY_SONAME})) { + $self->output(<< "__EOD__" # Symlink $ctx->{LIBRARY_SONAME} bin/$ctx->{LIBRARY_SONAME}: bin/$ctx->{LIBRARY_REALNAME} \@echo Symlink \$\@ @@ -292,6 +302,33 @@ bin/$ctx->{LIBRARY_NAME}: bin/$ctx->{LIBRARY_SONAME} \@echo Symlink \$\@ \@ln -sf $ctx->{LIBRARY_SONAME} \$\@ +__EOD__ +); + } + } + + $self->output(<< "__EOD__" +# + +$installdir/$ctx->{LIBRARY_REALNAME}: \$($ctx->{TYPE}_$ctx->{NAME}_DEPEND_LIST) \$($ctx->{TYPE}_$ctx->{NAME}_OBJ_LIST) + \@echo Linking \$\@ + \@\$(SHLD) \$(SHLD_FLAGS) -o \$\@ \$(INSTALL_LINK_FLAGS) \\ + \$($ctx->{TYPE}_$ctx->{NAME}_LINK_FLAGS) \\ + \$($ctx->{TYPE}_$ctx->{NAME}_LINK_LIST) + +__EOD__ +); + if (defined($ctx->{LIBRARY_SONAME})) { + $self->output(<< "__EOD__" +# Symlink $ctx->{LIBRARY_SONAME} +$installdir/$ctx->{LIBRARY_SONAME}: $installdir/$ctx->{LIBRARY_REALNAME} + \@echo Symlink \$\@ + \@ln -sf $ctx->{LIBRARY_REALNAME} \$\@ +# Symlink $ctx->{LIBRARY_NAME} +$installdir/$ctx->{LIBRARY_NAME}: $installdir/$ctx->{LIBRARY_SONAME} + \@echo Symlink \$\@ + \@ln -sf $ctx->{LIBRARY_SONAME} \$\@ + __EOD__ ); } -- cgit