Fixes #2541, build failure with Wayland enabled, OpenGL ES disabled
authorGabriel Jacobo <gabomdq@gmail.com>
Tue, 13 May 2014 19:42:40 -0300
changeset 87743e2b3019a879
parent 8773 83077b1f989a
child 8775 047537a5a114
Fixes #2541, build failure with Wayland enabled, OpenGL ES disabled

Also includes an attempt at fixing building SDL on Ubuntu 13.10, which hopefully
won't break 14.04
configure
configure.in
     1.1 --- a/configure	Tue May 13 12:10:37 2014 -0700
     1.2 +++ b/configure	Tue May 13 19:42:40 2014 -0300
     1.3 @@ -18745,7 +18745,9 @@
     1.4          { $as_echo "$as_me:${as_lineno-$LINENO}: checking for Wayland support" >&5
     1.5  $as_echo_n "checking for Wayland support... " >&6; }
     1.6          video_wayland=no
     1.7 -        if test x$PKG_CONFIG != xno; then
     1.8 +        if  test x$PKG_CONFIG != xno && \
     1.9 +            test x$video_opengl_egl = xyes && \
    1.10 +            test x$video_opengles_v2 = xyes; then
    1.11              if $PKG_CONFIG --exists wayland-client wayland-egl wayland-cursor egl xkbcommon ; then
    1.12                  WAYLAND_CFLAGS=`$PKG_CONFIG --cflags wayland-client wayland-egl wayland-cursor xkbcommon`
    1.13                  WAYLAND_LIBS=`$PKG_CONFIG --libs wayland-client wayland-egl wayland-cursor xkbcommon`
    1.14 @@ -18895,7 +18897,31 @@
    1.15              if $PKG_CONFIG --exists mirclient egl xkbcommon ; then
    1.16                  MIR_CFLAGS=`$PKG_CONFIG --cflags mirclient egl xkbcommon`
    1.17                  MIR_LIBS=`$PKG_CONFIG --libs mirclient egl xkbcommon`
    1.18 +                save_CFLAGS="$CFLAGS"
    1.19 +                CFLAGS="$save_CFLAGS $MIR_CFLAGS"
    1.20 +
    1.21 +                                cat confdefs.h - <<_ACEOF >conftest.$ac_ext
    1.22 +/* end confdefs.h.  */
    1.23 +
    1.24 +                #include <mir_toolkit/mir_client_library.h>
    1.25 +
    1.26 +int
    1.27 +main ()
    1.28 +{
    1.29 +
    1.30 +                    MirMotionToolType tool = mir_motion_tool_type_mouse;
    1.31 +
    1.32 +  ;
    1.33 +  return 0;
    1.34 +}
    1.35 +_ACEOF
    1.36 +if ac_fn_c_try_compile "$LINENO"; then :
    1.37 +
    1.38                  video_mir=yes
    1.39 +
    1.40 +fi
    1.41 +rm -f core conftest.err conftest.$ac_objext conftest.$ac_ext
    1.42 +                CFLAGS="$save_CFLAGS"
    1.43              fi
    1.44          fi
    1.45          { $as_echo "$as_me:${as_lineno-$LINENO}: result: $video_mir" >&5
    1.46 @@ -22570,6 +22596,7 @@
    1.47                  if test x$enable_video = xyes; then
    1.48                      SOURCES="$SOURCES $srcdir/src/core/android/*.c $srcdir/src/video/android/*.c"
    1.49                      $as_echo "#define SDL_VIDEO_DRIVER_ANDROID 1" >>confdefs.h
    1.50 +                    SUMMARY_video="${SUMMARY_video} android"
    1.51                  fi
    1.52                  ;;
    1.53              *-*-linux*)         ARCH=linux ;;
    1.54 @@ -22602,12 +22629,12 @@
    1.55          CheckNAS
    1.56          CheckSNDIO
    1.57          CheckX11
    1.58 -        CheckWayland
    1.59 -        CheckMir
    1.60          CheckDirectFB
    1.61          CheckFusionSound
    1.62          CheckOpenGLX11
    1.63          CheckOpenGLESX11
    1.64 +        CheckMir
    1.65 +        CheckWayland
    1.66          CheckLibUDev
    1.67          CheckDBus
    1.68          CheckInputEvents
    1.69 @@ -22647,6 +22674,7 @@
    1.70  $as_echo "#define SDL_AUDIO_DRIVER_ANDROID 1" >>confdefs.h
    1.71  
    1.72                  SOURCES="$SOURCES $srcdir/src/audio/android/*.c"
    1.73 +                SUMMARY_audio="${SUMMARY_audio} android"
    1.74                  have_audio=yes
    1.75              ;;
    1.76            esac
     2.1 --- a/configure.in	Tue May 13 12:10:37 2014 -0700
     2.2 +++ b/configure.in	Tue May 13 19:42:40 2014 -0300
     2.3 @@ -1174,7 +1174,9 @@
     2.4          AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
     2.5          AC_MSG_CHECKING(for Wayland support)
     2.6          video_wayland=no
     2.7 -        if test x$PKG_CONFIG != xno; then
     2.8 +        if  test x$PKG_CONFIG != xno && \
     2.9 +            test x$video_opengl_egl = xyes && \
    2.10 +            test x$video_opengles_v2 = xyes; then
    2.11              if $PKG_CONFIG --exists wayland-client wayland-egl wayland-cursor egl xkbcommon ; then
    2.12                  WAYLAND_CFLAGS=`$PKG_CONFIG --cflags wayland-client wayland-egl wayland-cursor xkbcommon`
    2.13                  WAYLAND_LIBS=`$PKG_CONFIG --libs wayland-client wayland-egl wayland-cursor xkbcommon`
    2.14 @@ -1256,7 +1258,18 @@
    2.15              if $PKG_CONFIG --exists mirclient egl xkbcommon ; then
    2.16                  MIR_CFLAGS=`$PKG_CONFIG --cflags mirclient egl xkbcommon`
    2.17                  MIR_LIBS=`$PKG_CONFIG --libs mirclient egl xkbcommon`
    2.18 +                save_CFLAGS="$CFLAGS"
    2.19 +                CFLAGS="$save_CFLAGS $MIR_CFLAGS"
    2.20 +                
    2.21 +                dnl This will disable Mir on Ubuntu < 14.04
    2.22 +                AC_TRY_COMPILE([
    2.23 +                #include <mir_toolkit/mir_client_library.h>
    2.24 +                ],[
    2.25 +                    MirMotionToolType tool = mir_motion_tool_type_mouse;
    2.26 +                ],[
    2.27                  video_mir=yes
    2.28 +                ])
    2.29 +                CFLAGS="$save_CFLAGS"
    2.30              fi
    2.31          fi
    2.32          AC_MSG_RESULT($video_mir)
    2.33 @@ -2691,12 +2704,12 @@
    2.34          CheckNAS
    2.35          CheckSNDIO
    2.36          CheckX11
    2.37 -        CheckWayland
    2.38 -        CheckMir
    2.39          CheckDirectFB
    2.40          CheckFusionSound
    2.41          CheckOpenGLX11
    2.42          CheckOpenGLESX11
    2.43 +        CheckMir
    2.44 +        CheckWayland
    2.45          CheckLibUDev
    2.46          CheckDBus
    2.47          CheckInputEvents