[master] 493b5e586 fix visibility attributes autocrap test for SUNCC
Nils Goroll
nils.goroll at uplex.de
Tue Feb 26 15:04:08 UTC 2019
commit 493b5e586f804ab87a7991c41e6a5053a4167639
Author: Nils Goroll <nils.goroll at uplex.de>
Date: Tue Feb 26 15:59:07 2019 +0100
fix visibility attributes autocrap test for SUNCC
Spotted by @lkarsten
diff --git a/configure.ac b/configure.ac
index 985dd64d1..24956aaca 100644
--- a/configure.ac
+++ b/configure.ac
@@ -241,15 +241,21 @@ AC_CHECK_FUNCS([pthread_setname_np])
AC_CHECK_FUNCS([pthread_mutex_isowned_np])
LIBS="${save_LIBS}"
+AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+
# Support for visibility attribute
save_CFLAGS="${CFLAGS}"
-CFLAGS="${CFLAGS} -Werror"
+if test "$SUNCC" = "yes" ; then
+ CFLAGS="${CFLAGS} -errwarn=%all,no%E_EMPTY_TRANSLATION_UNIT"
+else
+ CFLAGS="${CFLAGS} -Werror"
+fi
AC_CACHE_CHECK([whether we have support for visibility attributes],
[ac_cv_have_viz],
[AC_RUN_IFELSE(
[AC_LANG_PROGRAM([[
- #if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33)
+ #if ((__GNUC__-0) * 10 + __GNUC_MINOR__-0 >= 33 || defined(__SUNPRO_C))
# define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
#else
# define ZLIB_INTERNAL
@@ -646,8 +652,6 @@ AX_CHECK_COMPILE_FLAG([-Wall],
[CFLAGS="${CFLAGS} -Wall"
OCFLAGS="${OCFLAGS} -Wall"])
-AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
-
if test "$SUNCC" = "yes" ; then
SUNCC_CFLAGS=" \
-errwarn=%all,no%E_EMPTY_TRANSLATION_UNIT \
More information about the varnish-commit
mailing list