summaryrefslogtreecommitdiff
path: root/m4/gcc4_visibility.m4
diff options
context:
space:
mode:
Diffstat (limited to 'm4/gcc4_visibility.m4')
-rw-r--r--m4/gcc4_visibility.m421
1 files changed, 21 insertions, 0 deletions
diff --git a/m4/gcc4_visibility.m4 b/m4/gcc4_visibility.m4
index 708d42b..e58a0d7 100644
--- a/m4/gcc4_visibility.m4
+++ b/m4/gcc4_visibility.m4
@@ -19,3 +19,24 @@ AC_DEFUN([CHECK_GCC_FVISIBILITY], [
CFLAGS="$saved_CFLAGS"
AC_LANG_POP([C])
])
+
+AC_DEFUN([CHECK_LD_SYMVERS], [
+ AC_MSG_CHECKING([linker support for symbol maps])
+ echo '{global:*;};' >conftest.map
+ saved_LDFLAGS="$LDFLAGS"
+ LDFLAGS="$LDFLAGS -Wl,--version-script=conftest.map"
+ AC_LINK_IFELSE([AC_LANG_SOURCE([ int main() { return 0; } ])],
+ [with_ldsym=yes], [with_ldsym=no])
+ LDFLAGS="$saved_LDFLAGS"
+ rm conftest.map
+ AM_CONDITIONAL([WITH_LDSYM], [test "$with_ldsym" = yes])
+ AS_IF([test -n "$LD" && $LD -z help >/dev/null 2>/dev/null], [with_sun_ld=yes], [with_sun_ld=no])
+ AM_CONDITIONAL([WITH_SUN_LD], [test "$with_sun_ld" = yes])
+ AS_IF([test "$with_ldsym" = yes], [
+ AC_MSG_RESULT([-Wl,--version-script])
+ ], [test "$with_sun_ld" = yes], [
+ AC_MSG_RESULT([-M])
+ ], [
+ AC_MSG_RESULT([no])
+ ])
+])