summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorjelmer <jelmer@0c0555d6-39d7-0310-84fc-f1cc0bd64818>2007-11-06 04:59:50 +0000
committerStefan Metzmacher <metze@samba.org>2007-11-06 09:38:59 +0100
commitcaa6e6f5440e17fa39d2ae3147885ce311f3d278 (patch)
tree2bbe55d595b7ce3401a18803f1b62967f56aa580
parent29725af3bec1d81173e8f3a400cf059c2b67dfd1 (diff)
downloadsamba-caa6e6f5440e17fa39d2ae3147885ce311f3d278.tar.gz
samba-caa6e6f5440e17fa39d2ae3147885ce311f3d278.tar.bz2
samba-caa6e6f5440e17fa39d2ae3147885ce311f3d278.zip
Fix export dynamic for HPUX.
git-svn-id: svn+ssh://svn.samba.org/data/svn/samba/branches/SAMBA_4_0@25861 0c0555d6-39d7-0310-84fc-f1cc0bd64818 (This used to be commit 4d02b1344b76c6147944188161f73ad3917b8abc)
-rw-r--r--source3/lib/replace/libreplace_ld.m416
1 files changed, 12 insertions, 4 deletions
diff --git a/source3/lib/replace/libreplace_ld.m4 b/source3/lib/replace/libreplace_ld.m4
index 79367ba9db..cc5cefae60 100644
--- a/source3/lib/replace/libreplace_ld.m4
+++ b/source3/lib/replace/libreplace_ld.m4
@@ -1,10 +1,18 @@
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= ])
+if AC_TRY_COMMAND([${CC-cc} $CFLAGS -Wl,--version 2>&1 | grep "GNU ld" >/dev/null]); then
+ LD_EXPORT_DYNAMIC="-Wl,-export-dynamic"
+else
+ case "$host_os" in
+ hpux* )
+ LD_EXPORT_DYNAMIC="-Wl,-E"
+ ;;
+ * )
+ LD_EXPORT_DYNAMIC=""
+ ;;
+ esac
+fi
AC_SUBST(LD_EXPORT_DYNAMIC)
LDFLAGS="$saved_LDFLAGS"
])