configure.in
changeset 8159 427e8fdf6f69
parent 8158 429513cb6707
child 8161 6c5d35c8b3dd
equal deleted inserted replaced
8158:429513cb6707 8159:427e8fdf6f69
  1122     if test x$have_gcc_preferred_stack_boundary = xyes; then
  1122     if test x$have_gcc_preferred_stack_boundary = xyes; then
  1123         EXTRA_CFLAGS="$EXTRA_CFLAGS -mpreferred-stack-boundary=2"
  1123         EXTRA_CFLAGS="$EXTRA_CFLAGS -mpreferred-stack-boundary=2"
  1124     fi
  1124     fi
  1125 }
  1125 }
  1126 
  1126 
  1127 CheckMir()
       
  1128 {
       
  1129     AC_ARG_ENABLE(video-mir,
       
  1130     AC_HELP_STRING([--enable-video-mir], [use Mir video driver [[default=yes]]]),
       
  1131                    , enable_video_mir=yes)
       
  1132 
       
  1133     if test x$enable_video = xyes -a x$enable_video_mir = xyes; then
       
  1134         AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
       
  1135 
       
  1136         if test x$PKG_CONFIG != xno; then
       
  1137             AC_MSG_CHECKING(for Mir support)
       
  1138             video_mir=no
       
  1139             tmp_CFLAGS="$CFLAGS"
       
  1140             CFLAGS="$EXTRA_CFLAGS `$PKG_CONFIG --cflags egl mirclient xkbcommon`"
       
  1141 
       
  1142             AC_TRY_COMPILE([
       
  1143              #include <EGL/egl.h>
       
  1144              #include <xkbcommon/xkbcommon.h>
       
  1145              #include <mir_toolkit/mir_client_library.h>
       
  1146             ],[
       
  1147             ],[
       
  1148             video_mir=yes
       
  1149             ])
       
  1150             CFLAGS="$tmp_CFLAGS"
       
  1151             AC_MSG_RESULT($video_mir)
       
  1152 
       
  1153             if test x$video_mir = xyes; then
       
  1154                   AC_DEFINE(SDL_VIDEO_DRIVER_MIR)
       
  1155                   SOURCES="$SOURCES $srcdir/src/video/mir/*.c"
       
  1156                   EXTRA_CFLAGS="$EXTRA_CFLAGS `$PKG_CONFIG --cflags egl mirclient xkbcommon`"
       
  1157                   EXTRA_LDFLAGS="$EXTRA_LDFLAGS `$PKG_CONFIG --libs egl mirclient xkbcommon`"
       
  1158                   have_video=yes
       
  1159                   SUMMARY_video="${SUMMARY_video} mir"
       
  1160             fi
       
  1161         fi
       
  1162     fi
       
  1163 }
       
  1164 
       
  1165 dnl See if GCC's -Wall is supported.
  1127 dnl See if GCC's -Wall is supported.
  1166 CheckWarnAll()
  1128 CheckWarnAll()
  1167 {
  1129 {
  1168     AC_MSG_CHECKING(for GCC -Wall option)
  1130     AC_MSG_CHECKING(for GCC -Wall option)
  1169     have_gcc_Wall=no
  1131     have_gcc_Wall=no
  1249             if test x$enable_wayland_shared = xmaybe; then
  1211             if test x$enable_wayland_shared = xmaybe; then
  1250                 enable_wayland_shared=yes
  1212                 enable_wayland_shared=yes
  1251             fi
  1213             fi
  1252             if test x$have_loadso != xyes && \
  1214             if test x$have_loadso != xyes && \
  1253                test x$enable_wayland_shared = xyes; then
  1215                test x$enable_wayland_shared = xyes; then
  1254                 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic WAYLAND loading])
  1216                 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic Wayland loading])
  1255                 enable_wayland_shared=no
  1217                 enable_wayland_shared=no
  1256             fi
  1218             fi
  1257             if test x$have_loadso = xyes && \
  1219             if test x$have_loadso = xyes && \
  1258                test x$enable_wayland_shared = xyes && \
  1220                test x$enable_wayland_shared = xyes && \
  1259                test x$wayland_client_lib != x && \
  1221                test x$wayland_client_lib != x && \
  1261                test x$wayland_cursor_lib != x && \
  1223                test x$wayland_cursor_lib != x && \
  1262                test x$xkbcommon_lib != x; then
  1224                test x$xkbcommon_lib != x; then
  1263                 echo "-- dynamic libwayland-client -> $wayland_client_lib"
  1225                 echo "-- dynamic libwayland-client -> $wayland_client_lib"
  1264                 echo "-- dynamic libwayland-egl -> $wayland_egl_lib"
  1226                 echo "-- dynamic libwayland-egl -> $wayland_egl_lib"
  1265                 echo "-- dynamic libwayland-cursor -> $wayland_cursor_lib"
  1227                 echo "-- dynamic libwayland-cursor -> $wayland_cursor_lib"
  1266                 echo "-- dynamic xkbcommon -> $xkbcommon_lib"
  1228                 echo "-- dynamic libxkbcommon -> $xkbcommon_lib"
  1267                 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC, "$wayland_client_lib", [ ])
  1229                 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC, "$wayland_client_lib", [ ])
  1268                 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL, "$wayland_egl_lib", [ ])
  1230                 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL, "$wayland_egl_lib", [ ])
  1269                 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR, "$wayland_cursor_lib", [ ])
  1231                 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR, "$wayland_cursor_lib", [ ])
  1270                 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON, "$xkbcommon_lib", [ ])
  1232                 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON, "$xkbcommon_lib", [ ])
  1271                 SUMMARY_video="${SUMMARY_video} wayland(dynamic)"
  1233                 SUMMARY_video="${SUMMARY_video} wayland(dynamic)"
  1276             fi
  1238             fi
  1277             have_video=yes
  1239             have_video=yes
  1278         fi
  1240         fi
  1279     fi
  1241     fi
  1280 }
  1242 }
       
  1243 
       
  1244 dnl Check for Mir
       
  1245 CheckMir()
       
  1246 {
       
  1247     AC_ARG_ENABLE(video-mir,
       
  1248 AC_HELP_STRING([--enable-video-mir], [use Mir video driver [[default=yes]]]),
       
  1249                   ,enable_video_mir=yes)
       
  1250 
       
  1251     if test x$enable_video = xyes -a x$enable_video_mir = xyes; then
       
  1252         AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
       
  1253         AC_MSG_CHECKING(for Mir support)
       
  1254         video_mir=no
       
  1255         if test x$PKG_CONFIG != xno; then
       
  1256             if $PKG_CONFIG --exists mirclient egl xkbcommon ; then
       
  1257                 MIR_CFLAGS=`$PKG_CONFIG --cflags mirclient egl xkbcommon`
       
  1258                 MIR_LIBS=`$PKG_CONFIG --libs mirclient egl xkbcommon`
       
  1259                 video_mir=yes
       
  1260             fi
       
  1261         fi
       
  1262         AC_MSG_RESULT($video_mir)
       
  1263 
       
  1264         if test x$video_mir = xyes; then
       
  1265             AC_DEFINE(SDL_VIDEO_DRIVER_MIR, 1, [ ])
       
  1266             SOURCES="$SOURCES $srcdir/src/video/mir/*.c"
       
  1267             EXTRA_CFLAGS="$EXTRA_CFLAGS $MIR_CFLAGS"
       
  1268             AC_ARG_ENABLE(mir-shared,
       
  1269 AC_HELP_STRING([--enable-mir-shared], [dynamically load Mir support [[default=maybe]]]),
       
  1270                           , enable_mir_shared=maybe)
       
  1271 
       
  1272             dnl FIXME: Do BSD and OS X need special cases?
       
  1273             case "$host" in
       
  1274                 *)
       
  1275                     mirclient_lib=[`find_lib "libmirclient.so.*" "$MIR_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
       
  1276                     xkbcommon_lib=[`find_lib "libxkbcommon.so.*" "$MIR_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
       
  1277                     ;;
       
  1278             esac
       
  1279 
       
  1280             if test x$enable_mir_shared = xmaybe; then
       
  1281                 enable_mir_shared=yes
       
  1282             fi
       
  1283             if test x$have_loadso != xyes && \
       
  1284                test x$enable_mir_shared = xyes; then
       
  1285                 AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic Mir loading])
       
  1286                 enable_mir_shared=no
       
  1287             fi
       
  1288             if test x$have_loadso = xyes && \
       
  1289                test x$enable_mir_shared = xyes && \
       
  1290                test x$mirclient_lib != x && \
       
  1291                test x$xkbcommon_lib != x; then
       
  1292                 echo "-- dynamic libmirclient -> $mirclient_lib"
       
  1293                 echo "-- dynamic libxkbcommon -> $xkbcommon_lib"
       
  1294                 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_MIR_DYNAMIC, "$mirclient_lib", [ ])
       
  1295                 AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON, "$xkbcommon_lib", [ ])
       
  1296                 SUMMARY_video="${SUMMARY_video} mir(dynamic)"
       
  1297             else
       
  1298                 enable_mir_shared=no
       
  1299                 EXTRA_LDFLAGS="$EXTRA_LDFLAGS $MIR_LIBS"
       
  1300                 SUMMARY_video="${SUMMARY_video} mir"
       
  1301             fi
       
  1302             have_video=yes
       
  1303         fi
       
  1304     fi
       
  1305 }
       
  1306 
  1281 
  1307 
  1282 dnl Find the X11 include and library directories
  1308 dnl Find the X11 include and library directories
  1283 CheckX11()
  1309 CheckX11()
  1284 {
  1310 {
  1285 
  1311