aboutsummaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac38
1 files changed, 19 insertions, 19 deletions
diff --git a/configure.ac b/configure.ac
index a99e14257..8640008fd 100644
--- a/configure.ac
+++ b/configure.ac
@@ -450,25 +450,25 @@ CXXFLAGS="$save_CXXFLAGS"
dnl {{{ visibility support
AC_MSG_CHECKING([whether to enable visibility])
-AC_ARG_ENABLE([visibility],
- AS_HELP_STRING([--enable-visibility], [Enable visibility (g++-4.1)]),
- [ENABLE_VISIBILITY=$enableval],
- [ENABLE_VISIBILITY=no])
-AC_MSG_RESULT([$ENABLE_VISIBILITY])
-AC_SUBST([ENABLE_VISIBILITY])
-if test "x$ENABLE_VISIBILITY" = "xyes" ; then
- AC_MSG_CHECKING([for appropriate compiler visibility flags])
- old_PALUDIS_CXXFLAGS=$PALUDIS_CXXFLAGS
- PALUDIS_CXXFLAGS=
- CHECK_CXXFLAG([-fvisibility-inlines-hidden])
- CHECK_CXXFLAG([-fvisibility=hidden])
- AC_MSG_RESULT([$PALUDIS_CXXFLAGS])
- PALUDIS_CXXFLAGS_VISIBILITY="$PALUDIS_CXXFLAGS -DPALUDIS_ENABLE_VISIBILITY=1"
- PALUDIS_CXXFLAGS=$old_PALUDIS_CXXFLAGS
- PALUDIS_ENABLE_VISIBILITY=1
-else
- PALUDIS_ENABLE_VISIBILITY=0
-fi
+AC_PREPROC_IFELSE([AC_LANG_SOURCE([
+#if ! defined(__GNUC__) || defined(__clang__)
+# error no/broken visibility
+#endif
+])],
+ [AC_MSG_RESULT([yes])
+ AC_MSG_CHECKING([for appropriate compiler visibility flags])
+ old_PALUDIS_CXXFLAGS=$PALUDIS_CXXFLAGS
+ PALUDIS_CXXFLAGS=
+ CHECK_CXXFLAG([-fvisibility-inlines-hidden])
+ CHECK_CXXFLAG([-fvisibility=hidden])
+ AC_MSG_RESULT([$PALUDIS_CXXFLAGS])
+ PALUDIS_CXXFLAGS_VISIBILITY="$PALUDIS_CXXFLAGS -DPALUDIS_ENABLE_VISIBILITY=1"
+ PALUDIS_CXXFLAGS=$old_PALUDIS_CXXFLAGS
+ PALUDIS_ENABLE_VISIBILITY=1
+ ],
+ [AC_MSG_RESULT([no])
+ PALUDIS_ENABLE_VISIBILITY=0
+ ])
AC_SUBST([PALUDIS_ENABLE_VISIBILITY])
AC_SUBST([PALUDIS_CXXFLAGS_VISIBILITY])
dnl }}}