Commit a7761696 authored by Nils Goroll's avatar Nils Goroll Committed by Tollef Fog Heen

Check for __attribute__((visibility)) support

The solaris compiler does not support the GNU C extension
__attribute__((visibility("hidden"))), leading to build failures.
This commit adds a check for that support and defines NO_VIZ if it's
visibility setting is not supported.

Fixes #852
parent 8d1d603d
......@@ -209,6 +209,30 @@ if test "$ac_cv_so_sendfile_works" = yes; then
AC_DEFINE([SENDFILE_WORKS], [1], [Define if SENDFILE works])
fi
# Support for visibility attribute
save_CFLAGS="${CFLAGS}"
CFLAGS="${CFLAGS} -Werror"
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)
# define ZLIB_INTERNAL __attribute__((visibility ("hidden")))
#else
# define ZLIB_INTERNAL
#endif
int ZLIB_INTERNAL foo;
]],[])],
[ac_cv_have_viz=yes],
[ac_cv_have_viz=no])
])
if test "$ac_cv_have_viz" = no; then
libvgz_extra_cflags="-DNO_VIZ"
AC_SUBST(libvgz_extra_cflags)
fi
CFLAGS="${save_CFLAGS}"
# Userland slab allocator, available only on Solaris
case $target in
*-*-solaris*)
......
......@@ -3,7 +3,7 @@
lib_LTLIBRARIES = libvgz.la
libvgz_la_LDFLAGS = -version-info 1:0:0
libvgz_la_CFLAGS = -D_LARGEFILE64_SOURCE=1
libvgz_la_CFLAGS = -D_LARGEFILE64_SOURCE=1 $(libvgz_extra_cflags)
libvgz_la_SOURCES = \
adler32.c \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment