summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2008-11-28 02:01:57 -0200
committerPaulo Cesar Pereira de Andrade <pcpa@mandriva.com.br>2008-11-28 02:01:57 -0200
commit45c8bd0fe54273039fdaa1eeeafb81b5774f2c75 (patch)
tree7581d206097b0b591e526cfd091a793510ec7301
parent31285d063ec4623cb0764437d6d57e244f20460d (diff)
Enable compiling the X Server and modules with hidden symbols by default.
Note that it checks if support for symbol visibility is available by the compiler, not if it is functional. It may have problems on non x86 architectures. To disable the feature, just pass the option "--disable-visibility" to the X Server configure script. Unless using an alternate build schema, drivers built from a git checkout will use the same "visibility" related CFLAGS used to compile the X Server.
-rw-r--r--configure.ac43
-rw-r--r--xorg-server.pc.in2
2 files changed, 44 insertions, 1 deletions
diff --git a/configure.ac b/configure.ac
index ea3d0fa73..9beeca1a5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -504,6 +504,9 @@ AC_ARG_ENABLE(builtin-fonts, AS_HELP_STRING([--enable-builtin-fonts], [Use only
AC_ARG_ENABLE(null-root-cursor, AS_HELP_STRING([--enable-null-root-cursor], [Use an empty root cursor (default: use core cursor)]),
[NULL_ROOT_CURSOR=$enableval],
[NULL_ROOT_CURSOR=no])
+AC_ARG_ENABLE(visibility, AC_HELP_STRING([--enable-visibility], [Enable symbol visibility (default: auto)]),
+ [SYMBOL_VISIBILITY=$enableval],
+ [SYMBOL_VISIBILITY=auto])
dnl GLX build options
AC_ARG_WITH(mesa-source, AS_HELP_STRING([--with-mesa-source=MESA_SOURCE], [Path to Mesa source tree]),
@@ -1229,6 +1232,46 @@ if test "x$XORG" = xyes; then
XORG_CFLAGS="$XORGSERVER_CFLAGS -DHAVE_XORG_CONFIG_H"
XORG_LIBS="$COMPOSITE_LIB $FIXES_LIB $XEXTXORG_LIB $GLX_LIBS $RANDR_LIB $RENDER_LIB $DAMAGE_LIB $MIEXT_DAMAGE_LIB $MIEXT_SHADOW_LIB $XI_LIB $XKB_LIB $SELINUX_LIB"
+ dnl ==================================================================
+ dnl symbol visibility
+ symbol_visibility=
+ have_visibility=disabled
+ if test x$SYMBOL_VISIBILITY != xno; then
+ AC_MSG_CHECKING(for symbol visibility support)
+ if test x$GCC = xyes; then
+ VISIBILITY_CFLAGS="-fvisibility=hidden"
+ else
+ AC_CHECK_DECL([__SUNPRO_C], [SUNCC="yes"], [SUNCC="no"])
+ if test x$SUNCC = xyes; then
+ VISIBILITY_CFLAGS="-xldscope=hidden"
+ else
+ have_visibility=no
+ fi
+ fi
+ if test x$have_visibility != xno; then
+ save_CFLAGS="$CFLAGS"
+ CFLAGS="$CFLAGS $VISIBILITY_CFLAGS"
+ AC_TRY_COMPILE(
+ [#include <X11/Xfuncproto.h>
+ extern _X_HIDDEN int hidden_int;
+ extern _X_EXPORT int public_int;
+ extern _X_HIDDEN int hidden_int_func(void);
+ extern _X_EXPORT int public_int_func(void);],
+ [],
+ have_visibility=yes,
+ have_visibility=no)
+ CFLAGS=$save_CFLAGS
+ fi
+ AC_MSG_RESULT([$have_visibility])
+ if test x$have_visibility != xno; then
+ symbol_visibility=$VISIBILITY_CFLAGS
+ XORG_CFLAGS="$XORG_CFLAGS $VISIBILITY_CFLAGS"
+ fi
+ fi
+ dnl added to xorg-server.pc
+ AC_SUBST([symbol_visibility])
+ dnl ===================================================================
+
PKG_CHECK_MODULES([PCIACCESS], [pciaccess >= 0.8.0])
SAVE_LIBS=$LIBS
SAVE_CFLAGS=$CFLAGS
diff --git a/xorg-server.pc.in b/xorg-server.pc.in
index 139adf487..7547aa31b 100644
--- a/xorg-server.pc.in
+++ b/xorg-server.pc.in
@@ -15,5 +15,5 @@ Name: xorg-server
Description: Modular X.Org X Server
Version: @PACKAGE_VERSION@
Requires: pixman-1 pciaccess
-Cflags: -I${sdkdir}
+Cflags: -I${sdkdir} @symbol_visibility@
Libs: -L${libdir}