--- glib-2.16.3/configure.ac.orig 2008-05-21 17:11:07.349378569 +0100
+++ glib-2.16.3/configure.ac 2008-05-21 17:14:23.829557880 +0100
@@ -878,6 +878,28 @@ int main (int argc, char **argv)
return 0;
}
]])],g_have_gnuc_visibility=yes,g_have_gnuc_visibility=no)
+# Check if the compiler supports __attribute((alias(...)) for variables
+# Sun Studio 12 has gcc style visibility but does not support aliases
+# for variables and breaks the build (Bug 528506)
+if test "$g_have_gnuc_visibility" = yes ; then
+AC_MSG_CHECKING(if the compiler supports aliases for variables)
+GLIB_CHECK_COMPILE_WARNINGS([
+extern const int * const foo;
+
+static int real_foo;
+
+extern __typeof (foo) foo_alias __attribute((visibility("hidden")));
+
+const int * const foo_alias = &real_foo;
+
+extern __typeof (foo) foo __attribute((alias("foo_alias"),
+visibility("default")));
+
+int main () {
+ int i = *foo;
+}
+],g_have_gnuc_visibility=yes,g_have_gnuc_visibility=no)
+fi
AC_MSG_RESULT($g_have_gnuc_visibility)
AM_CONDITIONAL(HAVE_GNUC_VISIBILITY, [test x$g_have_gnuc_visibility = xyes])