summaryrefslogtreecommitdiff
path: root/source4/build/smb_build
diff options
context:
space:
mode:
Diffstat (limited to 'source4/build/smb_build')
-rw-r--r--source4/build/smb_build/makefile.pm9
1 files changed, 7 insertions, 2 deletions
diff --git a/source4/build/smb_build/makefile.pm b/source4/build/smb_build/makefile.pm
index e388308f85..4cd7e5681b 100644
--- a/source4/build/smb_build/makefile.pm
+++ b/source4/build/smb_build/makefile.pm
@@ -108,9 +108,11 @@ sub _prepare_compiler_linker($)
my $builddir_headers = "";
my $libdir;
+ my $extra_link_flags = "";
if ($self->{config}->{USESHARED} eq "true") {
$libdir = "\$(builddir)/bin/shared";
+ $extra_link_flags = "-Wl,-rpath-link,\$(builddir)/bin/shared";
} else {
$libdir = "\$(builddir)/bin/static";
}
@@ -134,6 +136,8 @@ PICFLAG=$self->{config}->{PICFLAG}
HOSTCC=$self->{config}->{HOSTCC}
HOSTCC_CFLAGS=-D_SAMBA_HOSTCC_ $self->{config}->{CFLAGS} \$(CPPFLAGS)
+INSTALL_LINK_FLAGS=$extra_link_flags
+
LD=$self->{config}->{LD}
LDFLAGS=$self->{config}->{LDFLAGS} -L$libdir
@@ -280,7 +284,7 @@ __EOD__
$ctx->{SHAREDDIR}/$ctx->{LIBRARY_REALNAME}: \$($ctx->{TYPE}_$ctx->{NAME}_DEPEND_LIST) \$($ctx->{TYPE}_$ctx->{NAME}_FULL_OBJ_LIST) $init_obj
\@echo Linking \$\@
\@mkdir -p $ctx->{SHAREDDIR}
- \@\$(SHLD) \$(SHLD_FLAGS) -o \$\@ \\
+ \@\$(SHLD) \$(SHLD_FLAGS) -o \$\@ \$(INSTALL_LINK_FLAGS) \\
\$($ctx->{TYPE}_$ctx->{NAME}_LINK_FLAGS) \\
\$($ctx->{TYPE}_$ctx->{NAME}\_FULL_OBJ_LIST) $soarg \\
$init_obj $singlesoarg
@@ -369,7 +373,8 @@ sub Binary($$)
$self->output(<< "__EOD__"
$installdir/$ctx->{BINARY}: \$($ctx->{TYPE}_$ctx->{NAME}_DEPEND_LIST) \$($ctx->{TYPE}_$ctx->{NAME}_FULL_OBJ_LIST)
\@echo Linking \$\@
- \@\$(LD) \$(LDFLAGS) -o \$\@ \$\($ctx->{TYPE}_$ctx->{NAME}_LINK_FLAGS)
+ \@\$(LD) \$(LDFLAGS) -o \$\@ \$(INSTALL_LINK_FLAGS) \\
+ \$\($ctx->{TYPE}_$ctx->{NAME}_LINK_FLAGS)
__EOD__
);