summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--source4/lib/ldb/Makefile.in2
-rw-r--r--source4/lib/ldb/configure.ac2
-rw-r--r--source4/lib/replace/libreplace.m41
-rw-r--r--source4/lib/replace/libreplace_ld.m410
4 files changed, 14 insertions, 1 deletions
diff --git a/source4/lib/ldb/Makefile.in b/source4/lib/ldb/Makefile.in
index 4a440e205a..a87d39f123 100644
--- a/source4/lib/ldb/Makefile.in
+++ b/source4/lib/ldb/Makefile.in
@@ -34,7 +34,7 @@ LDAP_LIBS = @LDAP_LIBS@
SHLIBEXT = @SHLIBEXT@
-LD_EXPORT_DYNAMIC = -Wl,--export-dynamic
+LD_EXPORT_DYNAMIC = @LD_EXPORT_DYNAMIC@
CFLAGS=-g -I$(srcdir)/include -Iinclude -I$(srcdir) -I$(srcdir)/.. \
$(POPT_CFLAGS) $(TALLOC_CFLAGS) $(TDB_CFLAGS) \
diff --git a/source4/lib/ldb/configure.ac b/source4/lib/ldb/configure.ac
index 6f19d88290..fac5d1542e 100644
--- a/source4/lib/ldb/configure.ac
+++ b/source4/lib/ldb/configure.ac
@@ -71,5 +71,7 @@ fi
AC_SUBST(TESTS)
AC_SUBST(EXTRA_OBJ)
+AC_LD_EXPORT_DYNAMIC
+
m4_include(libldb.m4)
AC_OUTPUT(Makefile ldb.pc)
diff --git a/source4/lib/replace/libreplace.m4 b/source4/lib/replace/libreplace.m4
index dd7dbf4e47..a02167ed17 100644
--- a/source4/lib/replace/libreplace.m4
+++ b/source4/lib/replace/libreplace.m4
@@ -355,5 +355,6 @@ CFLAGS="$CFLAGS -I$libreplacedir"
])
m4_include(libreplace_cc.m4)
+m4_include(libreplace_ld.m4)
m4_include(libreplace_macros.m4)
m4_include(autoconf-2.60.m4)
diff --git a/source4/lib/replace/libreplace_ld.m4 b/source4/lib/replace/libreplace_ld.m4
new file mode 100644
index 0000000000..8d7d3d7ebb
--- /dev/null
+++ b/source4/lib/replace/libreplace_ld.m4
@@ -0,0 +1,10 @@
+AC_DEFUN([AC_LD_EXPORT_DYNAMIC],
+[
+saved_LDFLAGS="$LDFLAGS"
+LDFLAGS="$LDFLAGS -Wl,--export-dynamic"
+AC_LINK_IFELSE([ int main() { return 0; } ],
+[ LD_EXPORT_DYNAMIC=-Wl,--export-dynamic ],
+[ LD_EXPORT_DYNAMIC= ])
+AC_SUBST(LD_EXPORT_DYNAMIC)
+LDFLAGS="$saved_LDFLAGS"
+])