diff options
Diffstat (limited to 'configure.ac')
-rw-r--r-- | configure.ac | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/configure.ac b/configure.ac index b8ca9302..e43e134a 100644 --- a/configure.ac +++ b/configure.ac @@ -556,6 +556,41 @@ AC_ARG_ENABLE(installed_tests, AM_CONDITIONAL(BUILDOPT_INSTALL_TESTS, test x$enable_installed_tests = xyes) +dnl ********************************************************************* +dnl * Check for -fvisibility=hidden to determine if we can do GNU-style * +dnl * visibility attributes for symbol export control * +dnl ********************************************************************* + +PANGO_HIDDEN_VISIBILITY_CFLAGS="" +case "$host" in + *-*-mingw*) + dnl on mingw32 we do -fvisibility=hidden and __declspec(dllexport) + AC_DEFINE([_PANGO_EXTERN], [__attribute__((visibility("default"))) __declspec(dllexport) extern], + [defines how to decorate public symbols while building]) + CFLAGS="${CFLAGS} -fvisibility=hidden" + ;; + *) + dnl on other compilers, check if we can do -fvisibility=hidden + SAVED_CFLAGS="${CFLAGS}" + CFLAGS="-fvisibility=hidden" + AC_MSG_CHECKING([for -fvisibility=hidden compiler flag]) + AC_TRY_COMPILE([], [return 0], + AC_MSG_RESULT(yes) + enable_fvisibility_hidden=yes, + AC_MSG_RESULT(no) + enable_fvisibility_hidden=no) + CFLAGS="${SAVED_CFLAGS}" + + AS_IF([test "${enable_fvisibility_hidden}" = "yes"], [ + AC_DEFINE([_PANGO_EXTERN], [__attribute__((visibility("default"))) extern], + [defines how to decorate public symbols while building]) + PANGO_HIDDEN_VISIBILITY_CFLAGS="-fvisibility=hidden" + ]) + ;; +esac +AC_SUBST(PANGO_HIDDEN_VISIBILITY_CFLAGS) + + AC_HEADER_DIRENT AC_CHECK_HEADERS(unistd.h) |