dnl CF_CHECK_FVISIBILITY version: 2 updated: 2020/04/04 16:16:13
dnl --------------------
dnl Check whether the compiler understands -fvisibility=hidden
dnl
dnl $1 = compiler
dnl $2 = compiler-flags variable name
dnl $3 = cache variable to set
AC_DEFUN([CF_CHECK_FVISIBILITY],[
AC_CACHE_CHECK(if $1 -fvisibility=hidden option works,$3,[
    cf_save_cflags="[$]$2"
    $2="[$]$2 -fvisibility=hidden"
    AC_TRY_LINK([
__attribute__ ((visibility("default"))) int somefunc() {return 42;}
	],[
	if (somefunc()) return 1;
],
    [$3=yes],
    [$3=no])
    $2=$cf_save_cflags
])
])dnl
