diff --git a/config.h.in b/config.h.in index 7574fc445..ce56c7fad 100644 --- a/config.h.in +++ b/config.h.in @@ -115,6 +115,9 @@ /* Define to 1 if you have the `dlopen' function. */ #undef HAVE_DLOPEN +/* Define to 1 if the compiler supports the __visibility__ attribute. */ +#undef HAVE_DSO_VISIBILITY + /* Define to 1 if your system has the F_CLOSEM fcntl. */ #undef HAVE_FCNTL_CLOSEM diff --git a/configure b/configure index e71ec5f9e..d34a3ccd1 100755 --- a/configure +++ b/configure @@ -20110,6 +20110,8 @@ eval ac_res=\$$as_CACHEVAR $as_echo "$ac_res" >&6; } if test x"`eval 'as_val=${'$as_CACHEVAR'};$as_echo "$as_val"'`" = xyes; then : + $as_echo "#define HAVE_DSO_VISIBILITY 1" >>confdefs.h + CFLAGS="${CFLAGS} -fvisibility=hidden" LTEXP="#" @@ -22740,5 +22742,6 @@ fi + diff --git a/configure.in b/configure.in index 62ad00dc1..9d14111b9 100644 --- a/configure.in +++ b/configure.in @@ -3173,6 +3173,7 @@ dnl into fatal errors (and there is no way to undo that) dnl AC_LANG_WERROR AX_CHECK_COMPILE_FLAG([-fvisibility=hidden], [ + AC_DEFINE(HAVE_DSO_VISIBILITY) CFLAGS="${CFLAGS} -fvisibility=hidden" LTEXP="#" ]) @@ -3460,6 +3461,7 @@ AH_TEMPLATE(RTLD_PRELOAD_VAR, [The environment variable that controls preloading AH_TEMPLATE(RTLD_PRELOAD_ENABLE_VAR, [An extra environment variable that is required to enable preloading (if any).]) AH_TEMPLATE(RTLD_PRELOAD_DELIM, [The delimiter to use when defining multiple preloaded objects.]) AH_TEMPLATE(RTLD_PRELOAD_DEFAULT, [The default value of preloaded objects (if any).]) +AH_TEMPLATE(HAVE_DSO_VISIBILITY, [Define to 1 if the compiler supports the __visibility__ attribute.]) dnl dnl Bits to copy verbatim into config.h.in diff --git a/include/missing.h b/include/missing.h index bf35d9a57..1c428fdab 100644 --- a/include/missing.h +++ b/include/missing.h @@ -53,7 +53,7 @@ #endif #ifndef __dso_public -# if __GNUC_PREREQ__(4, 0) +# ifdef HAVE_DSO_VISIBILITY # define __dso_public __attribute__((__visibility__("default"))) # define __dso_hidden __attribute__((__visibility__("hidden"))) # else