summaryrefslogtreecommitdiff
path: root/source4/build
diff options
context:
space:
mode:
authorJelmer Vernooij <jelmer@samba.org>2006-11-08 01:37:28 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:25:20 -0500
commitc4ee1af3fb835612360f9cc7a6fa1ead17b64340 (patch)
tree819419090979e113a6449fbf6b55e72dafb5d432 /source4/build
parente6a5fd44d01abdcaa082e5afc168a38848f35ccc (diff)
downloadsamba-c4ee1af3fb835612360f9cc7a6fa1ead17b64340.tar.gz
samba-c4ee1af3fb835612360f9cc7a6fa1ead17b64340.tar.bz2
samba-c4ee1af3fb835612360f9cc7a6fa1ead17b64340.zip
r19631: Re-enable shared libraries, but don't use -rpath-link unless
shared libraries are actually used. (This used to be commit 93e4f093b946cbb1b6deca82efdf0d5f033128b8)
Diffstat (limited to 'source4/build')
-rw-r--r--source4/build/m4/check_ld.m43
-rw-r--r--source4/build/smb_build/makefile.pm9
2 files changed, 7 insertions, 5 deletions
diff --git a/source4/build/m4/check_ld.m4 b/source4/build/m4/check_ld.m4
index c630658378..129ee00ebc 100644
--- a/source4/build/m4/check_ld.m4
+++ b/source4/build/m4/check_ld.m4
@@ -187,9 +187,6 @@ AC_TRY_RUN([#include "${srcdir-.}/build/tests/trivial.c"],
AC_MSG_WARN([cannot run when cross-compiling]))
-# TODO: remove this line when our shared libs correctly link without unresolved symbols
-BLDSHARED=false
-
USESHARED=false
AC_SUBST(USESHARED)
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__
);