configure.in
changeset 8104 2e4f1bd21196
parent 8094 9efaae827924
child 8124 5226058345bf
equal deleted inserted replaced
8103:d4a88c49247e 8104:2e4f1bd21196
  1131         AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
  1131         AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
  1132         AC_MSG_CHECKING(for Wayland support)
  1132         AC_MSG_CHECKING(for Wayland support)
  1133         video_wayland=no
  1133         video_wayland=no
  1134         if test x$PKG_CONFIG != xno; then
  1134         if test x$PKG_CONFIG != xno; then
  1135             if $PKG_CONFIG --exists wayland-client wayland-egl wayland-cursor egl xkbcommon ; then
  1135             if $PKG_CONFIG --exists wayland-client wayland-egl wayland-cursor egl xkbcommon ; then
  1136                 WAYLAND_CFLAGS=`$PKG_CONFIG --cflags wayland-client wayland-egl wayland-cursor egl xkbcommon`
  1136                 WAYLAND_CFLAGS=`$PKG_CONFIG --cflags wayland-client wayland-egl wayland-cursor xkbcommon`
  1137                 WAYLAND_LIBS=`$PKG_CONFIG --libs wayland-client wayland-egl wayland-cursor egl xkbcommon`
  1137                 WAYLAND_LIBS=`$PKG_CONFIG --libs wayland-client wayland-egl wayland-cursor xkbcommon`
  1138                 video_wayland=yes
  1138                 video_wayland=yes
  1139             fi
  1139             fi
  1140         fi
  1140         fi
  1141         AC_MSG_RESULT($video_wayland)
  1141         AC_MSG_RESULT($video_wayland)
  1142 
  1142 
  1145             if test x$enable_video_wayland_qt_touch = xyes; then
  1145             if test x$enable_video_wayland_qt_touch = xyes; then
  1146                 AC_DEFINE(SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH, 1, [ ])
  1146                 AC_DEFINE(SDL_VIDEO_DRIVER_WAYLAND_QT_TOUCH, 1, [ ])
  1147             fi
  1147             fi
  1148             SOURCES="$SOURCES $srcdir/src/video/wayland/*.c"
  1148             SOURCES="$SOURCES $srcdir/src/video/wayland/*.c"
  1149             EXTRA_CFLAGS="$EXTRA_CFLAGS $WAYLAND_CFLAGS"
  1149             EXTRA_CFLAGS="$EXTRA_CFLAGS $WAYLAND_CFLAGS"
  1150             dnl FIXME do dynamic loading code here.
  1150             AC_ARG_ENABLE(wayland-shared,
  1151             EXTRA_LDFLAGS="$EXTRA_LDFLAGS $WAYLAND_LIBS"
  1151 AC_HELP_STRING([--enable-wayland-shared], [dynamically load Wayland support [[default=maybe]]]),
       
  1152                           , enable_wayland_shared=maybe)
       
  1153 
       
  1154             dnl FIXME: Do BSD and OS X need special cases?
       
  1155             case "$host" in
       
  1156                 *)
       
  1157                     wayland_client_lib=[`find_lib "libwayland-client.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
       
  1158                     wayland_egl_lib=[`find_lib "libwayland-egl.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
       
  1159                     if test x$wayland_egl_lib = x; then
       
  1160                         dnl This works in Ubuntu 13.10, maybe others
       
  1161                         wayland_egl_lib=[`find_lib "mesa-egl/libwayland-egl.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
       
  1162                     fi
       
  1163                     wayland_cursor_lib=[`find_lib "libwayland-cursor.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
       
  1164                     xkbcommon_lib=[`find_lib "libxkbcommon.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
       
  1165                     ;;
       
  1166             esac
       
  1167 
       
  1168             if test x$enable_wayland_shared = xmaybe; then
       
  1169                 enable_wayland_shared=yes
       
  1170             fi
       
  1171             if test x$have_loadso != xyes && \
       
  1172                test x$enable_wayland_shared = xyes; then
       
  1173                 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic WAYLAND loading])
       
  1174                 enable_wayland_shared=no
       
  1175             fi
       
  1176             if test x$have_loadso = xyes && \
       
  1177                test x$enable_wayland_shared = xyes && \
       
  1178                test x$wayland_client_lib != x && \
       
  1179                test x$wayland_egl_lib != x && \
       
  1180                test x$wayland_cursor_lib != x && \
       
  1181                test x$xkbcommon_lib != x; then
       
  1182                 echo "-- dynamic libwayland-client -> $wayland_client_lib"
       
  1183                 echo "-- dynamic libwayland-egl -> $wayland_egl_lib"
       
  1184                 echo "-- dynamic libwayland-cursor -> $wayland_cursor_lib"
       
  1185                 echo "-- dynamic xkbcommon -> $xkbcommon_lib"
       
  1186                 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC, "$wayland_client_lib", [ ])
       
  1187                 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL, "$wayland_egl_lib", [ ])
       
  1188                 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR, "$wayland_cursor_lib", [ ])
       
  1189                 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON, "$xkbcommon_lib", [ ])
       
  1190             else
       
  1191                 enable_wayland_shared=no
       
  1192                 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $WAYLAND_LIBS"
       
  1193             fi
  1152             have_video=yes
  1194             have_video=yes
  1153         fi
  1195         fi
  1154     fi
  1196     fi
  1155 }
  1197 }
  1156 
  1198