summaryrefslogtreecommitdiff
path: root/m4/visibility.m4
diff options
context:
space:
mode:
authorThorsten Kukuk <kukuk@thkukuk.de>2006-07-28 13:12:36 +0000
committerThorsten Kukuk <kukuk@thkukuk.de>2006-07-28 13:12:36 +0000
commit562fb2da84e5b9e65a8279f5bae893236035a212 (patch)
tree9ba244d84c4d97e79b1eb4cc0f37e366ea38400a /m4/visibility.m4
parent7d8ba5e5958cb2bb25e58d6dbe39e2762a9a5241 (diff)
Relevant BUGIDs:
Purpose of commit: bugfix Commit summary: --------------- Update to gettext 0.15 to support new autoconf: 2006-07-28 Thorsten Kukuk <kukuk@thkukuk.de> * ABOUT-NLS: Upgrade to gettext-0.15. * config.rpath: Likewise. * m4/gettext.m4: Upgrade to gettext-0.15. * m4/inttypes-h.m4: New file, from gettext-0.15. * m4/inttypes-pri.m4: Upgrade to gettext-0.15. * m4/lib-link.m4: Upgrade to gettext-0.15. * m4/lib-prefix.m4: Upgrade to gettext-0.15. * m4/lock.m4: New file, from gettext-0.15. * m4/longdouble.m4: Upgrade to gettext-0.15. * m4/nls.m4: Upgrade to gettext-0.15. * m4/po.m4: Upgrade to gettext-0.15. * m4/size_max.m4: Upgrade to gettext-0.15. * m4/visibility.m4: New file, from gettext-0.15. * po/Makefile.in.in: Upgrade to gettext-0.15.
Diffstat (limited to 'm4/visibility.m4')
-rw-r--r--m4/visibility.m452
1 files changed, 52 insertions, 0 deletions
diff --git a/m4/visibility.m4 b/m4/visibility.m4
new file mode 100644
index 00000000..2ff6330a
--- /dev/null
+++ b/m4/visibility.m4
@@ -0,0 +1,52 @@
+# visibility.m4 serial 1 (gettext-0.15)
+dnl Copyright (C) 2005 Free Software Foundation, Inc.
+dnl This file is free software; the Free Software Foundation
+dnl gives unlimited permission to copy and/or distribute it,
+dnl with or without modifications, as long as this notice is preserved.
+
+dnl From Bruno Haible.
+
+dnl Tests whether the compiler supports the command-line option
+dnl -fvisibility=hidden and the function and variable attributes
+dnl __attribute__((__visibility__("hidden"))) and
+dnl __attribute__((__visibility__("default"))).
+dnl Does *not* test for __visibility__("protected") - which has tricky
+dnl semantics (see the 'vismain' test in glibc) and does not exist e.g. on
+dnl MacOS X.
+dnl Does *not* test for __visibility__("internal") - which has processor
+dnl dependent semantics.
+dnl Does *not* test for #pragma GCC visibility push(hidden) - which is
+dnl "really only recommended for legacy code".
+dnl Set the variable CFLAG_VISIBILITY.
+dnl Defines and sets the variable HAVE_VISIBILITY.
+
+AC_DEFUN([gl_VISIBILITY],
+[
+ AC_REQUIRE([AC_PROG_CC])
+ CFLAG_VISIBILITY=
+ HAVE_VISIBILITY=0
+ if test -n "$GCC"; then
+ AC_MSG_CHECKING([for simple visibility declarations])
+ AC_CACHE_VAL(gl_cv_cc_visibility, [
+ gl_save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS -fvisibility=hidden"
+ AC_TRY_COMPILE(
+ [extern __attribute__((__visibility__("hidden"))) int hiddenvar;
+ extern __attribute__((__visibility__("default"))) int exportedvar;
+ extern __attribute__((__visibility__("hidden"))) int hiddenfunc (void);
+ extern __attribute__((__visibility__("default"))) int exportedfunc (void);],
+ [],
+ gl_cv_cc_visibility=yes,
+ gl_cv_cc_visibility=no)
+ CFLAGS="$gl_save_CFLAGS"])
+ AC_MSG_RESULT([$gl_cv_cc_visibility])
+ if test $gl_cv_cc_visibility = yes; then
+ CFLAG_VISIBILITY="-fvisibility=hidden"
+ HAVE_VISIBILITY=1
+ fi
+ fi
+ AC_SUBST([CFLAG_VISIBILITY])
+ AC_SUBST([HAVE_VISIBILITY])
+ AC_DEFINE_UNQUOTED([HAVE_VISIBILITY], [$HAVE_VISIBILITY],
+ [Define to 1 or 0, depending whether the compiler supports simple visibility declarations.])
+])