comparison configure.in @ 2763:6fc50bdd88c0

Some cleanups on the new XInput code. One or two things got moved around, but largely this is hooked up correctly in the Unix configure system now: it can be dynamically loaded and fallback gracefully if not available, or libXi can be directly linked to libSDL. XInput support can be --disable'd from the configure script, too (defaults to enabled). Please note that while the framework is in place to gracefully fallback, the current state of the source requires XInput. We'll need to adjust a few things still to correct this.
author Ryan C. Gordon <icculus@icculus.org>
date Wed, 17 Sep 2008 08:20:57 +0000
parents 50bc882455e5
children 6d7baec32718
comparison
equal deleted inserted replaced
2762:90de10bc38ec 2763:6fc50bdd88c0
987 x11_symbols_private=yes 987 x11_symbols_private=yes
988 x11_lib='/usr/X11R6/lib/libX11.6.dylib' 988 x11_lib='/usr/X11R6/lib/libX11.6.dylib'
989 x11ext_lib='/usr/X11R6/lib/libXext.6.dylib' 989 x11ext_lib='/usr/X11R6/lib/libXext.6.dylib'
990 xrender_lib='/usr/X11R6/lib/libXrender.1.dylib' 990 xrender_lib='/usr/X11R6/lib/libXrender.1.dylib'
991 xrandr_lib='/usr/X11R6/lib/libXrandr.2.dylib' 991 xrandr_lib='/usr/X11R6/lib/libXrandr.2.dylib'
992 xinput_lib='/usr/X11R6/lib/libXi.6.dylib'
992 ;; 993 ;;
993 *-*-osf*) 994 *-*-osf*)
994 x11_lib='libX11.so' 995 x11_lib='libX11.so'
995 x11ext_lib='libXext.so' 996 x11ext_lib='libXext.so'
996 ;; 997 ;;
1023 xrandr_lib=[`ls -- $path/libXrandr.so.[0-9] 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`] 1024 xrandr_lib=[`ls -- $path/libXrandr.so.[0-9] 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
1024 if test "x$xrandr_lib" = "x"; then 1025 if test "x$xrandr_lib" = "x"; then
1025 xrandr_lib=[`ls -- $path/libXrandr.so.[0-9]* 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`] 1026 xrandr_lib=[`ls -- $path/libXrandr.so.[0-9]* 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
1026 fi 1027 fi
1027 fi 1028 fi
1029 if test "x$xinput_lib" = "x"; then
1030 xinput_lib=[`ls -- $path/libXi.so.[0-9] 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
1031 if test "x$xinput_lib" = "x"; then
1032 xinput_lib=[`ls -- $path/libXi.so.[0-9]* 2>/dev/null | sort -r | sed 's/.*\/\(.*\)/\1/; q'`]
1033 fi
1034 fi
1028 done 1035 done
1029 ;; 1036 ;;
1030 esac 1037 esac
1031 1038
1032 X_CFLAGS="$X_CFLAGS -DXTHREADS" 1039 X_CFLAGS="$X_CFLAGS -DXTHREADS"
1038 1045
1039 AC_DEFINE(SDL_VIDEO_DRIVER_X11) 1046 AC_DEFINE(SDL_VIDEO_DRIVER_X11)
1040 SOURCES="$SOURCES $srcdir/src/video/x11/*.c" 1047 SOURCES="$SOURCES $srcdir/src/video/x11/*.c"
1041 SOURCES="$SOURCES $srcdir/src/video/Xext/XmuStdCmap/*.c" 1048 SOURCES="$SOURCES $srcdir/src/video/Xext/XmuStdCmap/*.c"
1042 EXTRA_CFLAGS="$EXTRA_CFLAGS $X_CFLAGS" 1049 EXTRA_CFLAGS="$EXTRA_CFLAGS $X_CFLAGS"
1043
1044 echo "FIXME: Need to get dynamic loading of XInput working"
1045 enable_x11_shared=no
1046 1050
1047 if test x$enable_x11_shared = xmaybe; then 1051 if test x$enable_x11_shared = xmaybe; then
1048 enable_x11_shared=$x11_symbols_private 1052 enable_x11_shared=$x11_symbols_private
1049 fi 1053 fi
1050 if test x$have_loadso != xyes && \ 1054 if test x$have_loadso != xyes && \
1064 echo "-- dynamic libX11ext -> $x11ext_lib" 1068 echo "-- dynamic libX11ext -> $x11ext_lib"
1065 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC, "$x11_lib") 1069 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC, "$x11_lib")
1066 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT, "$x11ext_lib") 1070 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT, "$x11ext_lib")
1067 else 1071 else
1068 enable_x11_shared=no 1072 enable_x11_shared=no
1069 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $X_LIBS -lX11 -lXext -lXi" 1073 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $X_LIBS -lX11 -lXext"
1070 fi 1074 fi
1071 have_video=yes 1075 have_video=yes
1072 1076
1073 AC_ARG_ENABLE(video-x11-vm, 1077 AC_ARG_ENABLE(video-x11-vm,
1074 AC_HELP_STRING([--enable-video-x11-vm], [use X11 VM extension for fullscreen [[default=yes]]]), 1078 AC_HELP_STRING([--enable-video-x11-vm], [use X11 VM extension for fullscreen [[default=yes]]]),
1125 fi 1129 fi
1126 fi 1130 fi
1127 fi 1131 fi
1128 if test x$definitely_enable_video_x11_xrandr = xyes; then 1132 if test x$definitely_enable_video_x11_xrandr = xyes; then
1129 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XRANDR) 1133 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XRANDR)
1134 fi
1135 AC_ARG_ENABLE(video-x11-xinput,
1136 AC_HELP_STRING([--enable-video-x11-xinput], [enable X11 XInput extension for manymouse, tablets, etc [[default=yes]]]),
1137 , enable_video_x11_xinput=yes)
1138 if test x$enable_video_x11_xinput = xyes; then
1139 definitely_enable_video_x11_xinput=no
1140 AC_CHECK_HEADER(X11/extensions/XInput.h,
1141 have_xinput_h_hdr=yes,
1142 have_xinput_h_hdr=no,
1143 [#include <X11/Xlib.h>
1144 ])
1145 if test x$have_xinput_h_hdr = xyes; then
1146 if test x$enable_x11_shared = xyes && test x$xinput_lib != x ; then
1147 echo "-- dynamic libXi -> $xinput_lib"
1148 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_X11_DYNAMIC_XINPUT, "$xinput_lib")
1149 definitely_enable_video_x11_xinput=yes
1150 else
1151 AC_CHECK_LIB(Xi, XOpenDevice, have_xinput_lib=yes)
1152 if test x$have_xinput_lib = xyes ; then
1153 EXTRA_LDFLAGS="$EXTRA_LDFLAGS -lXi"
1154 definitely_enable_video_x11_xinput=yes
1155 fi
1156 fi
1157 fi
1158 fi
1159 if test x$definitely_enable_video_x11_xinput = xyes; then
1160 AC_DEFINE(SDL_VIDEO_DRIVER_X11_XINPUT)
1130 fi 1161 fi
1131 AC_ARG_ENABLE(video-x11-dpms, 1162 AC_ARG_ENABLE(video-x11-dpms,
1132 AC_HELP_STRING([--enable-video-x11-dpms], [enable X11 DPMS extension [[default=yes]]]), 1163 AC_HELP_STRING([--enable-video-x11-dpms], [enable X11 DPMS extension [[default=yes]]]),
1133 , enable_video_x11_dpms=yes) 1164 , enable_video_x11_dpms=yes)
1134 if test x$enable_video_x11_dpms = xyes; then 1165 if test x$enable_video_x11_dpms = xyes; then