[Xfce4-commits] <libxfce4util:master> Revert "Use Xdt visibility macro."

Nick Schermer noreply at xfce.org
Fri Jun 17 19:30:01 CEST 2011


Updating branch refs/heads/master
         to 13ece4adf52f4573576335add3fe92e7b4a08427 (commit)
       from 9a165c2d087ee45bb5f3f0af4a238ffdedb7b285 (commit)

commit 13ece4adf52f4573576335add3fe92e7b4a08427
Author: Nick Schermer <nick at xfce.org>
Date:   Fri Jun 17 18:49:14 2011 +0200

    Revert "Use Xdt visibility macro."
    
    This reverts commit 4286db4497523e672842cd767efe86976cdbdd82.

 configure.in.in |   31 ++++++++++++++++++++++++++++++-
 1 files changed, 30 insertions(+), 1 deletions(-)

diff --git a/configure.in.in b/configure.in.in
index 626e726..0d57c0e 100644
--- a/configure.in.in
+++ b/configure.in.in
@@ -159,7 +159,36 @@ XDT_FEATURE_LINKER_OPTS()
 dnl ****************************************
 dnl *** Check for ELF visibility support ***
 dnl ****************************************
-XDT_FEATURE_VISIBILITY()
+AC_ARG_ENABLE([visibility], AC_HELP_STRING([--disable-visibility], [Do not use ELF visibility attributes]), [], [enable_visibility=yes])
+have_gnuc_visibility=no
+if test x"$enable_visibility" != x"no"; then
+  dnl Check whether the compiler supports the visibility attribute
+  save_CFLAGS="$CFLAGS"
+  CFLAGS="$CFLAGS -Wall -Werror"
+  AC_MSG_CHECKING([whether $CC supports the GNUC visibility attribute])
+  AC_COMPILE_IFELSE(AC_LANG_SOURCE(
+  [
+    void test_default (void);
+    void test_hidden (void);
+
+    void __attribute__ ((visibility("default"))) test_default (void) {}
+    void __attribute__ ((visibility("hidden"))) test_hidden (void) {}
+
+    int main (int argc, char **argv) { test_default (); test_hidden (); return 0; }
+  ]),
+  [
+    have_gnuc_visibility=yes
+    AC_MSG_RESULT([yes])
+  ],
+  [
+    AC_MSG_RESULT([no])
+  ])
+  CFLAGS="$save_CFLAGS"
+fi
+if test x"$have_gnuc_visibility" = x"yes"; then
+  CPPFLAGS="$CPPFLAGS -DHAVE_GNUC_VISIBILITY"
+fi
+AM_CONDITIONAL([HAVE_GNUC_VISIBILITY], [test x"$have_gnuc_visibility" = x"yes"])
 
 dnl *************************************
 dnl *** Compensate for broken gtk-doc ***



More information about the Xfce4-commits mailing list