configure
changeset 8153 3e43c73ac79b
parent 8147 9802c269104f
child 8158 429513cb6707
--- a/configure	Sun Feb 02 21:38:16 2014 -0500
+++ b/configure	Sun Feb 02 23:41:46 2014 -0500
@@ -817,6 +817,7 @@
 enable_sndio_shared
 enable_diskaudio
 enable_dummyaudio
+enable_video_mir
 enable_video_wayland
 enable_video_wayland_qt_touch
 enable_wayland_shared
@@ -1534,6 +1535,7 @@
   --enable-sndio-shared   dynamically load sndio audio support [[default=yes]]
   --enable-diskaudio      support the disk writer audio driver [[default=yes]]
   --enable-dummyaudio     support the dummy audio driver [[default=yes]]
+  --enable-video-mir      use Mir video driver [[default=yes]]
   --enable-video-wayland  use Wayland video driver [[default=yes]]
   --enable-video-wayland-qt-touch
                           QtWayland server support for Wayland video driver
@@ -18627,6 +18629,103 @@
     fi
 }
 
+CheckMir()
+{
+    # Check whether --enable-video-mir was given.
+if test "${enable_video_mir+set}" = set; then :
+  enableval=$enable_video_mir;
+else
+  enable_video_mir=yes
+fi
+
+
+    if test x$enable_video = xyes -a x$enable_video_mir = xyes; then
+        # Extract the first word of "pkg-config", so it can be a program name with args.
+set dummy pkg-config; ac_word=$2
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for $ac_word" >&5
+$as_echo_n "checking for $ac_word... " >&6; }
+if ${ac_cv_path_PKG_CONFIG+:} false; then :
+  $as_echo_n "(cached) " >&6
+else
+  case $PKG_CONFIG in
+  [\\/]* | ?:[\\/]*)
+  ac_cv_path_PKG_CONFIG="$PKG_CONFIG" # Let the user override the test with a path.
+  ;;
+  *)
+  as_save_IFS=$IFS; IFS=$PATH_SEPARATOR
+for as_dir in $PATH
+do
+  IFS=$as_save_IFS
+  test -z "$as_dir" && as_dir=.
+    for ac_exec_ext in '' $ac_executable_extensions; do
+  if as_fn_executable_p "$as_dir/$ac_word$ac_exec_ext"; then
+    ac_cv_path_PKG_CONFIG="$as_dir/$ac_word$ac_exec_ext"
+    $as_echo "$as_me:${as_lineno-$LINENO}: found $as_dir/$ac_word$ac_exec_ext" >&5
+    break 2
+  fi
+done
+  done
+IFS=$as_save_IFS
+
+  test -z "$ac_cv_path_PKG_CONFIG" && ac_cv_path_PKG_CONFIG="no"
+  ;;
+esac
+fi
+PKG_CONFIG=$ac_cv_path_PKG_CONFIG
+if test -n "$PKG_CONFIG"; then
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: $PKG_CONFIG" >&5
+$as_echo "$PKG_CONFIG" >&6; }
+else
+  { $as_echo "$as_me:${as_lineno-$LINENO}: result: no" >&5
+$as_echo "no" >&6; }
+fi
+
+
+
+        if test x$PKG_CONFIG != xno; then
+            { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Mir support" >&5
+$as_echo_n "checking for Mir support... " >&6; }
+            video_mir=no
+            tmp_CFLAGS="$CFLAGS"
+            CFLAGS="$EXTRA_CFLAGS `$PKG_CONFIG --cflags egl mirclient xkbcommon`"
+
+            cat confdefs.h - <<_ACEOF >conftest.$ac_ext
+/* end confdefs.h.  */
+
+             #include <EGL/egl.h>
+             #include <xkbcommon/xkbcommon.h>
+             #include <mir_toolkit/mir_client_library.h>
+
+int
+main ()
+{
+
+
+  ;
+  return 0;
+}
+_ACEOF
+if ac_fn_c_try_compile "$LINENO"; then :
+
+            video_mir=yes
+
+fi
+rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
+            CFLAGS="$tmp_CFLAGS"
+            { $as_echo "$as_me:${as_lineno-$LINENO}: result: $video_mir" >&5
+$as_echo "$video_mir" >&6; }
+
+            if test x$video_mir = xyes; then
+                  $as_echo "#define SDL_VIDEO_DRIVER_MIR 1" >>confdefs.h
+
+                  SOURCES="$SOURCES $srcdir/src/video/mir/*.c"
+                  EXTRA_CFLAGS="$EXTRA_CFLAGS `$PKG_CONFIG --cflags egl mirclient xkbcommon`"
+                  EXTRA_LDFLAGS="$EXTRA_LDFLAGS `$PKG_CONFIG --libs egl mirclient xkbcommon`"
+                  have_video=yes
+            fi
+        fi
+    fi
+}
 
 CheckWarnAll()
 {
@@ -22451,6 +22550,7 @@
         CheckSNDIO
         CheckX11
         CheckWayland
+        CheckMir
         CheckDirectFB
         CheckFusionSound
         CheckOpenGLX11