1#
2# Determine if the compiler accepts -fvisibility-inlines-hidden
3#
4# This macro is specific to LLVM.
5#
6AC_DEFUN([AC_CXX_USE_VISIBILITY_INLINES_HIDDEN],
7[AC_CACHE_CHECK([for compiler -fvisibility-inlines-hidden option],
8                [llvm_cv_cxx_visibility_inlines_hidden],
9[ AC_LANG_PUSH([C++])
10  oldcxxflags="$CXXFLAGS"
11  CXXFLAGS="$CXXFLAGS -O0 -fvisibility-inlines-hidden -Werror"
12  AC_COMPILE_IFELSE([AC_LANG_PROGRAM(
13    [template <typename T> struct X { void __attribute__((noinline)) f() {} };],
14    [X<int>().f();])],
15    [llvm_cv_cxx_visibility_inlines_hidden=yes],[llvm_cv_cxx_visibility_inlines_hidden=no])
16  CXXFLAGS="$oldcxxflags"
17  AC_LANG_POP([C++])
18])
19if test "$llvm_cv_cxx_visibility_inlines_hidden" = yes ; then
20  AC_SUBST([ENABLE_VISIBILITY_INLINES_HIDDEN],[1])
21else
22  AC_SUBST([ENABLE_VISIBILITY_INLINES_HIDDEN],[0])
23fi
24])
25