configure.in
changeset 8159 427e8fdf6f69
parent 8158 429513cb6707
child 8161 6c5d35c8b3dd
     1.1 --- a/configure.in	Mon Feb 03 11:14:25 2014 -0500
     1.2 +++ b/configure.in	Mon Feb 03 11:52:54 2014 -0500
     1.3 @@ -1124,44 +1124,6 @@
     1.4      fi
     1.5  }
     1.6  
     1.7 -CheckMir()
     1.8 -{
     1.9 -    AC_ARG_ENABLE(video-mir,
    1.10 -    AC_HELP_STRING([--enable-video-mir], [use Mir video driver [[default=yes]]]),
    1.11 -                   , enable_video_mir=yes)
    1.12 -
    1.13 -    if test x$enable_video = xyes -a x$enable_video_mir = xyes; then
    1.14 -        AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
    1.15 -
    1.16 -        if test x$PKG_CONFIG != xno; then
    1.17 -            AC_MSG_CHECKING(for Mir support)
    1.18 -            video_mir=no
    1.19 -            tmp_CFLAGS="$CFLAGS"
    1.20 -            CFLAGS="$EXTRA_CFLAGS `$PKG_CONFIG --cflags egl mirclient xkbcommon`"
    1.21 -
    1.22 -            AC_TRY_COMPILE([
    1.23 -             #include <EGL/egl.h>
    1.24 -             #include <xkbcommon/xkbcommon.h>
    1.25 -             #include <mir_toolkit/mir_client_library.h>
    1.26 -            ],[
    1.27 -            ],[
    1.28 -            video_mir=yes
    1.29 -            ])
    1.30 -            CFLAGS="$tmp_CFLAGS"
    1.31 -            AC_MSG_RESULT($video_mir)
    1.32 -
    1.33 -            if test x$video_mir = xyes; then
    1.34 -                  AC_DEFINE(SDL_VIDEO_DRIVER_MIR)
    1.35 -                  SOURCES="$SOURCES $srcdir/src/video/mir/*.c"
    1.36 -                  EXTRA_CFLAGS="$EXTRA_CFLAGS `$PKG_CONFIG --cflags egl mirclient xkbcommon`"
    1.37 -                  EXTRA_LDFLAGS="$EXTRA_LDFLAGS `$PKG_CONFIG --libs egl mirclient xkbcommon`"
    1.38 -                  have_video=yes
    1.39 -                  SUMMARY_video="${SUMMARY_video} mir"
    1.40 -            fi
    1.41 -        fi
    1.42 -    fi
    1.43 -}
    1.44 -
    1.45  dnl See if GCC's -Wall is supported.
    1.46  CheckWarnAll()
    1.47  {
    1.48 @@ -1251,7 +1213,7 @@
    1.49              fi
    1.50              if test x$have_loadso != xyes && \
    1.51                 test x$enable_wayland_shared = xyes; then
    1.52 -                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic WAYLAND loading])
    1.53 +                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic Wayland loading])
    1.54                  enable_wayland_shared=no
    1.55              fi
    1.56              if test x$have_loadso = xyes && \
    1.57 @@ -1263,7 +1225,7 @@
    1.58                  echo "-- dynamic libwayland-client -> $wayland_client_lib"
    1.59                  echo "-- dynamic libwayland-egl -> $wayland_egl_lib"
    1.60                  echo "-- dynamic libwayland-cursor -> $wayland_cursor_lib"
    1.61 -                echo "-- dynamic xkbcommon -> $xkbcommon_lib"
    1.62 +                echo "-- dynamic libxkbcommon -> $xkbcommon_lib"
    1.63                  AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC, "$wayland_client_lib", [ ])
    1.64                  AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL, "$wayland_egl_lib", [ ])
    1.65                  AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR, "$wayland_cursor_lib", [ ])
    1.66 @@ -1279,6 +1241,70 @@
    1.67      fi
    1.68  }
    1.69  
    1.70 +dnl Check for Mir
    1.71 +CheckMir()
    1.72 +{
    1.73 +    AC_ARG_ENABLE(video-mir,
    1.74 +AC_HELP_STRING([--enable-video-mir], [use Mir video driver [[default=yes]]]),
    1.75 +                  ,enable_video_mir=yes)
    1.76 +
    1.77 +    if test x$enable_video = xyes -a x$enable_video_mir = xyes; then
    1.78 +        AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
    1.79 +        AC_MSG_CHECKING(for Mir support)
    1.80 +        video_mir=no
    1.81 +        if test x$PKG_CONFIG != xno; then
    1.82 +            if $PKG_CONFIG --exists mirclient egl xkbcommon ; then
    1.83 +                MIR_CFLAGS=`$PKG_CONFIG --cflags mirclient egl xkbcommon`
    1.84 +                MIR_LIBS=`$PKG_CONFIG --libs mirclient egl xkbcommon`
    1.85 +                video_mir=yes
    1.86 +            fi
    1.87 +        fi
    1.88 +        AC_MSG_RESULT($video_mir)
    1.89 +
    1.90 +        if test x$video_mir = xyes; then
    1.91 +            AC_DEFINE(SDL_VIDEO_DRIVER_MIR, 1, [ ])
    1.92 +            SOURCES="$SOURCES $srcdir/src/video/mir/*.c"
    1.93 +            EXTRA_CFLAGS="$EXTRA_CFLAGS $MIR_CFLAGS"
    1.94 +            AC_ARG_ENABLE(mir-shared,
    1.95 +AC_HELP_STRING([--enable-mir-shared], [dynamically load Mir support [[default=maybe]]]),
    1.96 +                          , enable_mir_shared=maybe)
    1.97 +
    1.98 +            dnl FIXME: Do BSD and OS X need special cases?
    1.99 +            case "$host" in
   1.100 +                *)
   1.101 +                    mirclient_lib=[`find_lib "libmirclient.so.*" "$MIR_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
   1.102 +                    xkbcommon_lib=[`find_lib "libxkbcommon.so.*" "$MIR_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
   1.103 +                    ;;
   1.104 +            esac
   1.105 +
   1.106 +            if test x$enable_mir_shared = xmaybe; then
   1.107 +                enable_mir_shared=yes
   1.108 +            fi
   1.109 +            if test x$have_loadso != xyes && \
   1.110 +               test x$enable_mir_shared = xyes; then
   1.111 +                AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic Mir loading])
   1.112 +                enable_mir_shared=no
   1.113 +            fi
   1.114 +            if test x$have_loadso = xyes && \
   1.115 +               test x$enable_mir_shared = xyes && \
   1.116 +               test x$mirclient_lib != x && \
   1.117 +               test x$xkbcommon_lib != x; then
   1.118 +                echo "-- dynamic libmirclient -> $mirclient_lib"
   1.119 +                echo "-- dynamic libxkbcommon -> $xkbcommon_lib"
   1.120 +                AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_MIR_DYNAMIC, "$mirclient_lib", [ ])
   1.121 +                AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON, "$xkbcommon_lib", [ ])
   1.122 +                SUMMARY_video="${SUMMARY_video} mir(dynamic)"
   1.123 +            else
   1.124 +                enable_mir_shared=no
   1.125 +                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $MIR_LIBS"
   1.126 +                SUMMARY_video="${SUMMARY_video} mir"
   1.127 +            fi
   1.128 +            have_video=yes
   1.129 +        fi
   1.130 +    fi
   1.131 +}
   1.132 +
   1.133 +
   1.134  dnl Find the X11 include and library directories
   1.135  CheckX11()
   1.136  {