configure.in
changeset 1879 cb232e63552c
parent 1875 4627eca2c02b
child 1886 44635227a939
equal deleted inserted replaced
1878:d7c9d7f42881 1879:cb232e63552c
   811                 ;;
   811                 ;;
   812         esac
   812         esac
   813         AC_PATH_X
   813         AC_PATH_X
   814         AC_PATH_XTRA
   814         AC_PATH_XTRA
   815         if test x$have_x = xyes; then
   815         if test x$have_x = xyes; then
       
   816             # Only allow dynamically loaded X11 if the X11 function pointers
       
   817             # will not end up in the global namespace, which causes problems
       
   818             # with other libraries calling X11 functions.
       
   819             x11_symbols_private=$have_gcc_fvisibility
       
   820 
   816             AC_ARG_ENABLE(x11-shared,
   821             AC_ARG_ENABLE(x11-shared,
   817 AC_HELP_STRING([--enable-x11-shared], [dynamically load X11 support [[default=yes]]]),
   822 AC_HELP_STRING([--enable-x11-shared], [dynamically load X11 support [[default=maybe]]]),
   818                           , enable_x11_shared=yes)
   823                           , enable_x11_shared=maybe)
   819 
   824 
   820             case "$host" in
   825             case "$host" in
   821                 *-*-darwin*) # Latest Mac OS X actually ships with Xrandr/Xrender libs...
   826                 *-*-darwin*) # Latest Mac OS X actually ships with Xrandr/Xrender libs...
       
   827                     x11_symbols_private=yes
   822                     x11_lib='/usr/X11R6/lib/libX11.6.dylib'
   828                     x11_lib='/usr/X11R6/lib/libX11.6.dylib'
   823                     x11ext_lib='/usr/X11R6/lib/libXext.6.dylib'
   829                     x11ext_lib='/usr/X11R6/lib/libXext.6.dylib'
   824                     xrender_lib='/usr/X11R6/lib/libXrender.1.dylib'
   830                     xrender_lib='/usr/X11R6/lib/libXrender.1.dylib'
   825                     xrandr_lib='/usr/X11R6/lib/libXrandr.2.dylib'
   831                     xrandr_lib='/usr/X11R6/lib/libXrandr.2.dylib'
   826                     ;;
   832                     ;;
   835                 *)
   841                 *)
   836                     x11_lib_spec=[`echo $X_LIBS | sed 's/.*-L\([^ ]*\).*/\1/'`]
   842                     x11_lib_spec=[`echo $X_LIBS | sed 's/.*-L\([^ ]*\).*/\1/'`]
   837                     for path in $x11_lib_path /usr/lib /usr/X11/lib /usr/X11R6/lib; do
   843                     for path in $x11_lib_path /usr/lib /usr/X11/lib /usr/X11R6/lib; do
   838                         if test "x$x11_lib" = "x"; then
   844                         if test "x$x11_lib" = "x"; then
   839                             x11_lib=[`ls -- $path/libX11.so.[0-9] 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
   845                             x11_lib=[`ls -- $path/libX11.so.[0-9] 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
   840 							if test "x$x11_lib" = "x"; then
   846                             if test "x$x11_lib" = "x"; then
   841 								x11_lib=[`ls -- $path/libX11.so.[0-9]* 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
   847                                 x11_lib=[`ls -- $path/libX11.so.[0-9]* 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
   842 							fi
   848                             fi
   843                         fi
   849                         fi
   844                         if test "x$x11ext_lib" = "x"; then
   850                         if test "x$x11ext_lib" = "x"; then
   845                             x11ext_lib=[`ls -- $path/libXext.so.[0-9] 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
   851                             x11ext_lib=[`ls -- $path/libXext.so.[0-9] 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
   846 							if test "x$x11ext_lib" = "x"; then
   852                             if test "x$x11ext_lib" = "x"; then
   847 								x11ext_lib=[`ls -- $path/libXext.so.[0-9]* 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
   853                                 x11ext_lib=[`ls -- $path/libXext.so.[0-9]* 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
   848 							fi
   854                             fi
   849                         fi
   855                         fi
   850                         if test "x$xrender_lib" = "x"; then
   856                         if test "x$xrender_lib" = "x"; then
   851                             xrender_lib=[`ls -- $path/libXrender.so.[0-9] 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
   857                             xrender_lib=[`ls -- $path/libXrender.so.[0-9] 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
   852 							if test "x$xrender_lib" = "x"; then
   858                             if test "x$xrender_lib" = "x"; then
   853 								xrender_lib=[`ls -- $path/libXrender.so.[0-9]* 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
   859                                 xrender_lib=[`ls -- $path/libXrender.so.[0-9]* 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
   854 							fi
   860                             fi
   855                         fi
   861                         fi
   856                         if test "x$xrandr_lib" = "x"; then
   862                         if test "x$xrandr_lib" = "x"; then
   857                             xrandr_lib=[`ls -- $path/libXrandr.so.[0-9] 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
   863                             xrandr_lib=[`ls -- $path/libXrandr.so.[0-9] 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
   858 							if test "x$xrandr_lib" = "x"; then
   864                             if test "x$xrandr_lib" = "x"; then
   859 								xrandr_lib=[`ls -- $path/libXrandr.so.[0-9]* 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
   865                                 xrandr_lib=[`ls -- $path/libXrandr.so.[0-9]* 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
   860 							fi
   866                             fi
   861                         fi
   867                         fi
   862                     done
   868                     done
   863                     ;;
   869                     ;;
   864             esac
   870             esac
   865 
   871 
   871             LDFLAGS="$LDFLAGS $X_LIBS"
   877             LDFLAGS="$LDFLAGS $X_LIBS"
   872 
   878 
   873             AC_DEFINE(SDL_VIDEO_DRIVER_X11)
   879             AC_DEFINE(SDL_VIDEO_DRIVER_X11)
   874             SOURCES="$SOURCES $srcdir/src/video/x11/*.c"
   880             SOURCES="$SOURCES $srcdir/src/video/x11/*.c"
   875             EXTRA_CFLAGS="$EXTRA_CFLAGS $X_CFLAGS"
   881             EXTRA_CFLAGS="$EXTRA_CFLAGS $X_CFLAGS"
       
   882 
       
   883             if test x$enable_x11_shared = xmaybe; then
       
   884                 enable_x11_shared=$x11_symbols_private
       
   885             fi
   876             if test x$have_loadso != xyes && \
   886             if test x$have_loadso != xyes && \
   877                test x$enable_x11_shared = xyes; then
   887                test x$enable_x11_shared = xyes; then
   878                 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic X11 loading])
   888                 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic X11 loading])
   879                 enable_x11_shared=no
   889                 enable_x11_shared=no
   880             fi
   890             fi
   881 
   891             if test x$x11_symbols_private != xyes && \
   882             if test x$have_gcc_fvisibility != xyes && \
       
   883                test x$enable_x11_shared = xyes; then
   892                test x$enable_x11_shared = xyes; then
   884                 AC_MSG_WARN([You must have gcc4 (-fvisibility=hidden) for dynamic X11 loading])
   893                 AC_MSG_WARN([You must have gcc4 (-fvisibility=hidden) for dynamic X11 loading])
   885                 enable_x11_shared=no
   894                 enable_x11_shared=no
   886             fi
   895             fi
   887 
   896