Use hidden attribute for private functions when compiling with Sun Studio
authorGinn Chen <ginn.chen@sun.com>
Thu, 21 Aug 2008 21:21:01 +0000 (14:21 -0700)
committerAlan Coopersmith <alan.coopersmith@sun.com>
Thu, 21 Aug 2008 21:21:01 +0000 (14:21 -0700)
https://bugs.freedesktop.org/show_bug.cgi?id=17183

Signed-off-by: Alan Coopersmith <alan.coopersmith@sun.com>
configure.ac
pixman/pixman-private.h

index 702bed0..0cf32c7 100644 (file)
@@ -123,6 +123,21 @@ if test "x$have_gcc4" = "xyes"; then
 fi
 AC_MSG_RESULT($have_gcc4)
 
+have_sunstudio8=no
+AC_MSG_CHECKING([for -xldscope (Sun compilers)])
+AC_COMPILE_IFELSE([
+#if defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
+#else
+#error Need Sun Studio 8 for visibility
+#endif
+int main () { return 0; } 
+], have_sunstudio8=yes)
+
+if test "x$have_sunstudio8" = "xyes"; then
+   CFLAGS="$CFLAGS -xldscope=hidden"
+fi
+AC_MSG_RESULT($have_sunstudio8)
+
 dnl ===========================================================================
 dnl Check for MMX
 
index a27d2a8..e26a0c3 100644 (file)
@@ -729,6 +729,9 @@ pixman_compute_composite_region32 (pixman_region32_t *      pRegion,
 /* GCC visibility */
 #if defined(__GNUC__) && __GNUC__ >= 4
 #define PIXMAN_EXPORT __attribute__ ((visibility("default")))
+/* Sun Studio 8 visibility */
+#elif defined(__SUNPRO_C) && (__SUNPRO_C >= 0x550)
+#define PIXMAN_EXPORT __global
 #else
 #define PIXMAN_EXPORT
 #endif