diff options
author | Stefan Metzmacher <metze@samba.org> | 2006-03-07 14:00:57 +0000 |
---|---|---|
committer | Gerald (Jerry) Carter <jerry@samba.org> | 2007-10-10 13:52:29 -0500 |
commit | 04af4d0cc3c38d9de38fb21cbbfb9e19f28c7ea9 (patch) | |
tree | 76bfbf13ef21eab51d1be9a23d190bd1d6b3fca7 | |
parent | 1718e2d4df28ecdf39247b8095ec61a4abab49fe (diff) | |
download | samba-04af4d0cc3c38d9de38fb21cbbfb9e19f28c7ea9.tar.gz samba-04af4d0cc3c38d9de38fb21cbbfb9e19f28c7ea9.tar.bz2 samba-04af4d0cc3c38d9de38fb21cbbfb9e19f28c7ea9.zip |
r13940: use the local vs. install linkerflag trick for shared libs too
metze
(This used to be commit 65bb303ff3815cc11e07061d478e317ffb24d453)
-rw-r--r-- | source4/build/smb_build/makefile.pm | 49 |
1 files changed, 43 insertions, 6 deletions
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 \$\@ @@ -294,6 +304,33 @@ bin/$ctx->{LIBRARY_NAME}: bin/$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__ +); } } |