mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 15:40:41 -05:00
clutter: Assume compiler supports visibility flag and attributes
Unconditionally pass -fvisibility=hidden to compiler and define _CLUTTER_EXTERN to __attribute__((visibility("default"))) extern.
This commit is contained in:
parent
e3c6e3b84d
commit
db77e2e187
@ -14,6 +14,7 @@ AM_CPPFLAGS = \
|
||||
-DCLUTTER_COMPILATION=1 \
|
||||
-DCOGL_DISABLE_DEPRECATION_WARNINGS \
|
||||
-DG_LOG_DOMAIN=\"Clutter\" \
|
||||
-fvisibility=hidden \
|
||||
-I$(top_srcdir) \
|
||||
-I$(top_srcdir)/clutter \
|
||||
-I$(top_builddir) \
|
||||
@ -23,7 +24,6 @@ AM_CPPFLAGS = \
|
||||
-I$(top_builddir)/../cogl/cogl \
|
||||
$(CLUTTER_DEPRECATED_CFLAGS) \
|
||||
$(CLUTTER_DEBUG_CFLAGS) \
|
||||
$(CLUTTER_HIDDEN_VISIBILITY_CFLAGS) \
|
||||
$(NULL)
|
||||
|
||||
AM_CFLAGS = $(CLUTTER_CFLAGS) $(MAINTAINER_CFLAGS)
|
||||
|
@ -90,9 +90,7 @@
|
||||
#define CLUTTER_PRIVATE_FIELD(x) clutter_private_ ## x
|
||||
#endif
|
||||
|
||||
#ifndef _CLUTTER_EXTERN
|
||||
#define _CLUTTER_EXTERN extern
|
||||
#endif
|
||||
#define _CLUTTER_EXTERN __attribute__((visibility("default"))) extern
|
||||
|
||||
#if __GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 6) || \
|
||||
__clang_major__ > 3 || (__clang_major__ == 3 && __clang_minor__ >= 4)
|
||||
|
@ -101,26 +101,6 @@ AC_ARG_ENABLE([Bsymbolic],
|
||||
AS_IF([test "x$enable_Bsymbolic" = "xyes"], [CLUTTER_LINK_FLAGS=-Wl[,]-Bsymbolic-functions])
|
||||
AC_SUBST(CLUTTER_LINK_FLAGS)
|
||||
|
||||
# Check for the visibility flags
|
||||
CLUTTER_HIDDEN_VISIBILITY_CFLAGS=""
|
||||
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([_CLUTTER_EXTERN], [__attribute__((visibility("default"))) extern],
|
||||
[defines how to decorate public symbols while building])
|
||||
CLUTTER_HIDDEN_VISIBILITY_CFLAGS="-fvisibility=hidden"
|
||||
])
|
||||
AC_SUBST(CLUTTER_HIDDEN_VISIBILITY_CFLAGS)
|
||||
|
||||
AC_CACHE_SAVE
|
||||
|
||||
dnl ========================================================================
|
||||
|
Loading…
Reference in New Issue
Block a user