-fvisibility=hidden is no longer a requirement for dynamic X11.
authorRyan C. Gordon <icculus@icculus.org>
Tue, 19 Nov 2013 15:00:39 -0500
changeset 8016 3746af784462
parent 8015 ba26f042e36d
child 8017 d84a30e5cbd5
-fvisibility=hidden is no longer a requirement for dynamic X11. We don't clash with Xlib symbols anymore.
cmake/sdlchecks.cmake
configure.in
--- a/cmake/sdlchecks.cmake	Tue Nov 19 11:04:05 2013 -0300
+++ b/cmake/sdlchecks.cmake	Tue Nov 19 15:00:39 2013 -0500
@@ -331,15 +331,8 @@
       set(SOURCE_FILES ${SOURCE_FILES} ${X11_SOURCES})
       set(SDL_VIDEO_DRIVER_X11 1)
 
-      if(HAVE_GCC_FVISIBILITY)
-        set(X11_SYMBOLS_PRIVATE TRUE)
-      else()
-        set(X11_SYMBOLS_PRIVATE FALSE)
-      endif(HAVE_GCC_FVISIBILITY)
-
       if(APPLE)
         set(X11_SHARED OFF)
-        set(X11_SYMBOLS_PRIVATE TRUE)
       endif(APPLE)
 
       check_function_exists("shmat" HAVE_SHMAT)
@@ -358,10 +351,6 @@
         if(NOT HAVE_DLOPEN)
           message_warn("You must have SDL_LoadObject() support for dynamic X11 loading")
           set(HAVE_X11_SHARED FALSE)
-          if(X11_SYMBOLS_PRIVATE)
-            message_warn("You must have gcc4 (-fvisibility=hidden) for dynamic X11 loading")
-            set(HAVE_X11_SHARED TRUE)
-          endif(X11_SYMBOLS_PRIVATE)
         else(NOT HAVE_DLOPEN)
           set(HAVE_X11_SHARED TRUE)
         endif()
--- a/configure.in	Tue Nov 19 11:04:05 2013 -0300
+++ b/configure.in	Tue Nov 19 15:00:39 2013 -0500
@@ -1140,18 +1140,12 @@
         AC_PATH_X
         AC_PATH_XTRA
         if test x$have_x = xyes; then
-            # Only allow dynamically loaded X11 if the X11 function pointers
-            # will not end up in the global namespace, which causes problems
-            # with other libraries calling X11 functions.
-            x11_symbols_private=$have_gcc_fvisibility
-
             AC_ARG_ENABLE(x11-shared,
 AC_HELP_STRING([--enable-x11-shared], [dynamically load X11 support [[default=maybe]]]),
                           , enable_x11_shared=maybe)
 
             case "$host" in
                 *-*-darwin*)
-                    x11_symbols_private=yes
                     x11_lib='/usr/X11R6/lib/libX11.6.dylib'
                     x11ext_lib='/usr/X11R6/lib/libXext.6.dylib'
                     xcursor_lib='/usr/X11R6/lib/libXcursor.1.dylib'
@@ -1212,19 +1206,13 @@
             SDL_CFLAGS="$SDL_CFLAGS $X_CFLAGS"
 
             if test x$enable_x11_shared = xmaybe; then
-                enable_x11_shared=$x11_symbols_private
+                enable_x11_shared=yes
             fi
             if test x$have_loadso != xyes && \
                test x$enable_x11_shared = xyes; then
                 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic X11 loading])
                 enable_x11_shared=no
             fi
-            if test x$x11_symbols_private != xyes && \
-               test x$enable_x11_shared = xyes; then
-                AC_MSG_WARN([You must have gcc4 (-fvisibility=hidden) for dynamic X11 loading])
-                enable_x11_shared=no
-            fi
-
             if test x$have_loadso = xyes && \
                test x$enable_x11_shared = xyes && test x$x11_lib != x && test x$x11ext_lib != x; then
                 echo "-- dynamic libX11 -> $x11_lib"