comparison configure.in @ 1589:34cca785be57

Xrandr support in the X11 target. Fixes Bugzilla #109, and as a bonus, Bugzilla #145, too!
author Ryan C. Gordon <icculus@icculus.org>
date Wed, 22 Mar 2006 11:13:58 +0000
parents e20dcef5647c
children 802de24df8d9
comparison
equal deleted inserted replaced
1588:e20dcef5647c 1589:34cca785be57
787 AC_ARG_ENABLE(x11-shared, 787 AC_ARG_ENABLE(x11-shared,
788 AC_HELP_STRING([--enable-x11-shared], [dynamically load X11 support [default=yes]]), 788 AC_HELP_STRING([--enable-x11-shared], [dynamically load X11 support [default=yes]]),
789 , enable_x11_shared=yes) 789 , enable_x11_shared=yes)
790 790
791 case "$host" in 791 case "$host" in
792 *-*-darwin*) 792 *-*-darwin*) # Latest Mac OS X actually ships with Xrandr/Xrender libs...
793 x11_lib='/usr/X11R6/lib/libX11.6.dylib' 793 x11_lib='/usr/X11R6/lib/libX11.6.dylib'
794 x11ext_lib='/usr/X11R6/lib/libXext.6.dylib' 794 x11ext_lib='/usr/X11R6/lib/libXext.6.dylib'
795 xrandr_lib='/usr/X11R6/lib/libXrandr.2.dylib'
796 xrender_lib='/usr/X11R6/lib/libXrender.1.dylib'
795 ;; 797 ;;
796 *-*-osf*) 798 *-*-osf*)
797 x11_lib='libX11.so' 799 x11_lib='libX11.so'
798 x11ext_lib='libXext.so' 800 x11ext_lib='libXext.so'
799 ;; 801 ;;
808 x11_lib=[`ls $path/libX11.so.[0-9] 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`] 810 x11_lib=[`ls $path/libX11.so.[0-9] 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
809 fi 811 fi
810 if test "x$x11ext_lib" = "x"; then 812 if test "x$x11ext_lib" = "x"; then
811 x11ext_lib=[`ls $path/libXext.so.[0-9] 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`] 813 x11ext_lib=[`ls $path/libXext.so.[0-9] 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
812 fi 814 fi
815 if test "x$xrender_lib" = "x"; then
816 xrender_lib=[`ls $path/libXrender.so.[0-9] 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
817 fi
818 if test "x$xrandr_lib" = "x"; then
819 xrandr_lib=[`ls $path/libXrandr.so.[0-9] 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
820 fi
813 done 821 done
814 ;; 822 ;;
815 esac 823 esac
816 824
817 X_CFLAGS="$X_CFLAGS -DXTHREADS" 825 X_CFLAGS="$X_CFLAGS -DXTHREADS"
831 echo "-- dynamic libX11 -> $x11_lib" 839 echo "-- dynamic libX11 -> $x11_lib"
832 echo "-- dynamic libX11ext -> $x11ext_lib" 840 echo "-- dynamic libX11ext -> $x11ext_lib"
833 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC, "$x11_lib") 841 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC, "$x11_lib")
834 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT, "$x11ext_lib") 842 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT, "$x11ext_lib")
835 else 843 else
844 enable_x11_shared=no
836 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $X_LIBS -lX11 -lXext" 845 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $X_LIBS -lX11 -lXext"
837 fi 846 fi
838 have_video=yes 847 have_video=yes
839 848
840 AC_ARG_ENABLE(dga, 849 AC_ARG_ENABLE(dga,
881 AC_HELP_STRING([--enable-video-x11-xme], [enable Xi Graphics XME for fullscreen [default=yes]]), 890 AC_HELP_STRING([--enable-video-x11-xme], [enable Xi Graphics XME for fullscreen [default=yes]]),
882 , enable_video_x11_xme=yes) 891 , enable_video_x11_xme=yes)
883 if test x$enable_video_x11_xme = xyes; then 892 if test x$enable_video_x11_xme = xyes; then
884 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XME) 893 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XME)
885 SOURCES="$SOURCES $srcdir/src/video/Xext/XME/*.c" 894 SOURCES="$SOURCES $srcdir/src/video/Xext/XME/*.c"
895 fi
896 AC_ARG_ENABLE(video-x11-xrandr,
897 AC_HELP_STRING([--enable-video-x11-xrandr], [enable X11 Xrandr extension for fullscreen [default=yes]]),
898 , enable_video_x11_xrandr=yes)
899 if test x$enable_video_x11_xrandr = xyes; then
900 definitely_enable_video_x11_xrandr=no
901 AC_CHECK_HEADER(X11/extensions/Xrandr.h,
902 have_xrandr_h_hdr=yes,
903 have_xrandr_h_hdr=no,
904 [#include <X11/Xlib.h>
905 ])
906 if test x$have_xrandr_h_hdr = xyes; then
907 if test x$enable_x11_shared = xyes && test x$xrandr_lib != x ; then
908 echo "-- dynamic libXrender -> $xrender_lib"
909 echo "-- dynamic libXrandr -> $xrandr_lib"
910 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRENDER, "$xrender_lib")
911 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR, "$xrandr_lib")
912 definitely_enable_video_x11_xrandr=yes
913 else
914 AC_CHECK_LIB(Xrender, XRenderQueryExtension, have_xrender_lib=yes)
915 AC_CHECK_LIB(Xrandr, XRRQueryExtension, have_xrandr_lib=yes)
916 if test x$have_xrender_lib = xyes && test x$have_xrandr_lib = xyes ; then
917 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXrandr -lXrender"
918 definitely_enable_video_x11_xrandr=yes
919 fi
920 fi
921 fi
922 fi
923
924 if test x$definitely_enable_video_x11_xrandr = xyes; then
925 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XRANDR)
886 fi 926 fi
887 fi 927 fi
888 fi 928 fi
889 } 929 }
890 930