r25846: Add configure test for -Wl,--export-dynamic.
authorJelmer Vernooij <jelmer@samba.org>
Tue, 6 Nov 2007 00:05:19 +0000 (01:05 +0100)
committerStefan Metzmacher <metze@samba.org>
Fri, 21 Dec 2007 04:44:24 +0000 (05:44 +0100)
source/lib/ldb/Makefile.in
source/lib/ldb/configure.ac
source/lib/replace/libreplace.m4
source/lib/replace/libreplace_ld.m4 [new file with mode: 0644]

index 4a440e205a45429a0b95b9bd434e4a070d48bf93..a87d39f1238b458ce298359a14d8ed2082d67a54 100644 (file)
@@ -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) \
index 6f19d882909cec2da716c88017ec6db10df507ba..fac5d1542ecdeb0574e03eff950195d38749732e 100644 (file)
@@ -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)
index dd7dbf4e4737db9f450a8734ff6861dae4d39d5d..a02167ed176dcccda2cc09a9b04a651e444b5942 100644 (file)
@@ -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/source/lib/replace/libreplace_ld.m4 b/source/lib/replace/libreplace_ld.m4
new file mode 100644 (file)
index 0000000..8d7d3d7
--- /dev/null
@@ -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"
+])