diff --git a/configure.ac b/configure.ac index ad8b250..676a70d 100644 --- a/configure.ac +++ b/configure.ac @@ -23,7 +23,7 @@ dnl Process this file with autoconf to create configure. AC_PREREQ([2.57]) AC_INIT([util-macros], - [1.1.5], + [1.1.6], [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg]) AM_INIT_AUTOMAKE([foreign dist-bzip2]) diff --git a/xorg-macros.m4.in b/xorg-macros.m4.in index 11b1419..691460b 100644 --- a/xorg-macros.m4.in +++ b/xorg-macros.m4.in @@ -419,3 +419,32 @@ AC_SUBST(LINTLIB) AM_CONDITIONAL(MAKE_LINT_LIB, [test x$make_lint_lib != xno]) ]) # XORG_LINT_LIBRARY + +# XORG_GCC_VISIBILITY() +# -------------------------- +# Minimum version: 1.1.6 +# +# Adds -fvisibility=hidden to CFLAGS if running with gcc 4 or greater. +# + +AC_DEFUN([XORG_VISIBILITY],[ + +AC_MSG_CHECKING([whether the compiler supports the visibility arg]) + +dnl Check for gcc4 or greater +AC_TRY_COMPILE([ +void +#if defined(__GNUC__) && (__GNUC__ >= 4) +foo () {}; +#endif +], [], [ + has_visibility=yes + CFLAGS="$CFLAGS -fvisibility=hidden" +], [ + has_visibility=no +] +) + +AC_MSG_RESULT($has_visibility) + +]) # XORG_GCC_VISIBILITY