[PATCH libdrm 2/2] configure.ac: set VISIBILITY_CFLAGS for SUNCC

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



For non-GCC (Sun) compilers check for "-xldscope=hidden". Use it if 
supported to hide the internal symbols.

Cc: Alan Coopersmith <alan.coopersmith@xxxxxxxxxx>
Signed-off-by: Emil Velikov <emil.l.velikov@xxxxxxxxx>
---
 configure.ac | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/configure.ac b/configure.ac
index 1fcc8de..91c6662 100644
--- a/configure.ac
+++ b/configure.ac
@@ -405,6 +405,19 @@ if test "x$GCC" = xyes; then
     # Restore CFLAGS; VISIBILITY_CFLAGS are added to it where needed.
     CFLAGS=$save_CFLAGS
     AC_SUBST([VISIBILITY_CFLAGS])
+else
+    # Enable -xldscope=hidden if using a compiler that supports it (SUNCC)
+    save_CFLAGS="$CFLAGS"
+    AC_MSG_CHECKING([whether $CC supports -xldscope=hidden])
+    VISIBILITY_CFLAGS="-xldscope=hidden"
+    CFLAGS="$CFLAGS $VISIBILITY_CFLAGS"
+    AC_LINK_IFELSE([AC_LANG_PROGRAM()], AC_MSG_RESULT([yes]),
+                   [VISIBILITY_CFLAGS=""; AC_MSG_RESULT([no])]);
+
+    # Restore CFLAGS; VISIBILITY_CFLAGS are added to it where needed.
+    CFLAGS=$save_CFLAGS
+    AC_SUBST([VISIBILITY_CFLAGS])
+
 fi
 
 AC_MSG_CHECKING([whether $CC supports __attribute__((visibility))])
-- 
2.3.1

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
http://lists.freedesktop.org/mailman/listinfo/dri-devel





[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux