summaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorSjoerd Simons <sjoerd@luon.net>2008-06-22 17:31:08 +0200
committerLennart Poettering <lennart@poettering.net>2008-06-24 00:17:34 +0200
commitd3c75ce883bf5b09321c44bb32522fe089ca1e52 (patch)
treec137c863225324925d79e8e36143991b603e062c /common
parent7fd720fcb51b7d1e7dd8dc8915f47ffc3f11edad (diff)
Hide everything except for the avahi_qt_poll_get symbol if possible in the qt bindings
Diffstat (limited to 'common')
-rw-r--r--common/gcc_visibility.m436
1 files changed, 36 insertions, 0 deletions
diff --git a/common/gcc_visibility.m4 b/common/gcc_visibility.m4
new file mode 100644
index 0000000..6b5a89d
--- /dev/null
+++ b/common/gcc_visibility.m4
@@ -0,0 +1,36 @@
+dnl @synopsis CHECK_VISIBILITY([ACTION-IF-FOUND[, ACTION-IF-NOT-FOUND]])
+dnl
+dnl @summary check for the gcc -fvisibility flag
+dnl
+
+AC_DEFUN([CHECK_VISIBILITY_HIDDEN], [
+ save_CFLAGS="$CFLAGS"
+ VISIBILITY_HIDDEN_CFLAGS=""
+ OPTION=-fvisibility=hidden
+
+ AC_MSG_CHECKING(for gcc $OPTION support)
+
+ CFLAGS="$CFLAGS $OPTION"
+
+ AC_TRY_COMPILE([
+ int default_vis __attribute__ ((visibility("default")));
+ int hidden_vis __attribute__ ((visibility("hidden")));
+ ],
+ [],
+ ac_visibility_supported=yes,
+ ac_visibility_supported=no)
+ AC_MSG_RESULT($ac_visibility_supported)
+
+ if test x"$ac_visibility_supported" = xyes; then
+ ifelse([$1],,AC_DEFINE(HAVE_GCC_VISIBILITY,1,[Define if you have gcc -fvisibility=hidden support ]),[$1])
+ VISIBILITY_HIDDEN_CFLAGS="$OPTION -DHAVE_VISIBILITY_HIDDEN"
+ AC_DEFINE(HAVE_VISIBILITY_HIDDEN,[],[Support for visibility hidden])
+ else
+ $2
+ :
+ fi
+
+ AC_SUBST(VISIBILITY_HIDDEN_CFLAGS)
+
+ CFLAGS="$save_CFLAGS"
+])