Skip to content

Commit

Permalink
mir: Removed mir client support.
Browse files Browse the repository at this point in the history
Fixes Bugzilla #4288.
  • Loading branch information
icculus committed Nov 3, 2018
1 parent 4026f89 commit bc57ac2
Show file tree
Hide file tree
Showing 29 changed files with 5 additions and 2,821 deletions.
3 changes: 0 additions & 3 deletions CMakeLists.txt
Expand Up @@ -326,8 +326,6 @@ set_option(VIDEO_X11 "Use X11 video driver" ${UNIX_SYS})
set_option(VIDEO_WAYLAND "Use Wayland video driver" ${UNIX_SYS})
dep_option(WAYLAND_SHARED "Dynamically load Wayland support" ON "VIDEO_WAYLAND" OFF)
dep_option(VIDEO_WAYLAND_QT_TOUCH "QtWayland server support for Wayland video driver" ON "VIDEO_WAYLAND" OFF)
set_option(VIDEO_MIR "Use Mir video driver" ${UNIX_SYS})
dep_option(MIR_SHARED "Dynamically load Mir support" ON "VIDEO_MIR" OFF)
set_option(VIDEO_RPI "Use Raspberry Pi video driver" ${UNIX_SYS})
dep_option(X11_SHARED "Dynamically load X11 support" ON "VIDEO_X11" OFF)
set(SDL_X11_OPTIONS Xcursor Xinerama XInput Xrandr Xscrnsaver XShape Xvm)
Expand Down Expand Up @@ -997,7 +995,6 @@ elseif(UNIX AND NOT APPLE AND NOT ANDROID)
# Need to check for Raspberry PI first and add platform specific compiler flags, otherwise the test for GLES fails!
CheckRPI()
CheckX11()
CheckMir()
CheckDirectFB()
CheckOpenGLX11()
CheckOpenGLESX11()
Expand Down
2 changes: 1 addition & 1 deletion build-scripts/raspberrypi-buildbot.sh
Expand Up @@ -42,7 +42,7 @@ SYSROOT="/opt/rpi-sysroot"
export CC="ccache /opt/rpi-tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc --sysroot=$SYSROOT -I$SYSROOT/opt/vc/include -I$SYSROOT/usr/include -I$SYSROOT/opt/vc/include/interface/vcos/pthreads -I$SYSROOT/opt/vc/include/interface/vmcs_host/linux -L$SYSROOT/opt/vc/lib"
# -L$SYSROOT/usr/lib/arm-linux-gnueabihf"
# !!! FIXME: shouldn't have to --disable-* things here.
../configure --with-sysroot=$SYSROOT --host=arm-raspberry-linux-gnueabihf --prefix=$PWD/rpi-sdl2-installed --disable-pulseaudio --disable-esd --disable-video-mir --disable-video-wayland
../configure --with-sysroot=$SYSROOT --host=arm-raspberry-linux-gnueabihf --prefix=$PWD/rpi-sdl2-installed --disable-pulseaudio --disable-esd --disable-video-wayland
$MAKE
$MAKE install
# Fix up a few things to a real install path on a real Raspberry Pi...
Expand Down
40 changes: 0 additions & 40 deletions cmake/sdlchecks.cmake
Expand Up @@ -564,46 +564,6 @@ macro(CheckX11)
endif()
endmacro()

# Requires:
# - EGL
# - PkgCheckModules
# Optional:
# - MIR_SHARED opt
# - HAVE_DLOPEN opt
macro(CheckMir)
if(VIDEO_MIR)
find_library(MIR_LIB mirclient mircommon egl)
pkg_check_modules(MIR_TOOLKIT mirclient>=0.26 mircommon)
pkg_check_modules(EGL egl)
pkg_check_modules(XKB xkbcommon)

if (MIR_LIB AND MIR_TOOLKIT_FOUND AND EGL_FOUND AND XKB_FOUND)
set(HAVE_VIDEO_MIR TRUE)
set(HAVE_SDL_VIDEO TRUE)

file(GLOB MIR_SOURCES ${SDL2_SOURCE_DIR}/src/video/mir/*.c)
set(SOURCE_FILES ${SOURCE_FILES} ${MIR_SOURCES})
set(SDL_VIDEO_DRIVER_MIR 1)

list(APPEND EXTRA_CFLAGS ${MIR_TOOLKIT_CFLAGS} ${EGL_CFLAGS} ${XKB_CFLAGS})

if(MIR_SHARED)
if(NOT HAVE_DLOPEN)
message_warn("You must have SDL_LoadObject() support for dynamic Mir loading")
else()
FindLibraryAndSONAME(mirclient)
FindLibraryAndSONAME(xkbcommon)
set(SDL_VIDEO_DRIVER_MIR_DYNAMIC "\"${MIRCLIENT_LIB_SONAME}\"")
set(SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON "\"${XKBCOMMON_LIB_SONAME}\"")
set(HAVE_MIR_SHARED TRUE)
endif()
else()
set(EXTRA_LIBS ${MIR_TOOLKIT_LIBRARIES} ${EXTRA_LIBS})
endif()
endif()
endif()
endmacro()

macro(WaylandProtocolGen _SCANNER _XML _PROTL)
set(_WAYLAND_PROT_C_CODE "${CMAKE_CURRENT_BINARY_DIR}/wayland-generated-protocols/${_PROTL}-protocol.c")
set(_WAYLAND_PROT_H_CODE "${CMAKE_CURRENT_BINARY_DIR}/wayland-generated-protocols/${_PROTL}-client-protocol.h")
Expand Down
151 changes: 0 additions & 151 deletions configure
Expand Up @@ -831,8 +831,6 @@ enable_libsamplerate_shared
enable_video_wayland
enable_video_wayland_qt_touch
enable_wayland_shared
enable_video_mir
enable_mir_shared
enable_video_rpi
enable_video_x11
with_x
Expand Down Expand Up @@ -1576,8 +1574,6 @@ Optional Features:
QtWayland server support for Wayland video driver
[[default=yes]]
--enable-wayland-shared dynamically load Wayland support [[default=maybe]]
--enable-video-mir use Mir video driver [[default=no]]
--enable-mir-shared dynamically load Mir support [[default=maybe]]
--enable-video-rpi use Raspberry Pi video driver [[default=yes]]
--enable-video-x11 use X11 video driver [[default=yes]]
--enable-x11-shared dynamically load X11 support [[default=maybe]]
Expand Down Expand Up @@ -19422,152 +19418,6 @@ _ACEOF
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=no
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


{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for Mir support" >&5
$as_echo_n "checking for Mir support... " >&6; }
video_mir=no
if test x$PKG_CONFIG != xno; then
if $PKG_CONFIG --exists mirclient egl xkbcommon ; then
MIR_CFLAGS=`$PKG_CONFIG --cflags mirclient egl xkbcommon`
MIR_LIBS=`$PKG_CONFIG --libs mirclient egl xkbcommon`
save_CFLAGS="$CFLAGS"
CFLAGS="$save_CFLAGS $MIR_CFLAGS"

cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */

#include <mir_toolkit/mir_client_library.h>

int
main ()
{

MirWindowAttrib attrib = mir_window_attrib_state

;
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="$save_CFLAGS"
fi
fi
{ $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 $MIR_CFLAGS"
# Check whether --enable-mir-shared was given.
if test "${enable_mir_shared+set}" = set; then :
enableval=$enable_mir_shared;
else
enable_mir_shared=maybe
fi


case "$host" in
*)
mirclient_lib=`find_lib "libmirclient.so.*" "$MIR_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`
xkbcommon_lib=`find_lib "libxkbcommon.so.*" "$MIR_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`
;;
esac

if test x$enable_mir_shared = xmaybe; then
enable_mir_shared=yes
fi
if test x$have_loadso != xyes && \
test x$enable_mir_shared = xyes; then
{ $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic Mir loading" >&5
$as_echo "$as_me: WARNING: You must have SDL_LoadObject() support for dynamic Mir loading" >&2;}
enable_mir_shared=no
fi
if test x$have_loadso = xyes && \
test x$enable_mir_shared = xyes && \
test x$mirclient_lib != x && \
test x$xkbcommon_lib != x; then
echo "-- dynamic libmirclient -> $mirclient_lib"
echo "-- dynamic libxkbcommon -> $xkbcommon_lib"

cat >>confdefs.h <<_ACEOF
#define SDL_VIDEO_DRIVER_MIR_DYNAMIC "$mirclient_lib"
_ACEOF


cat >>confdefs.h <<_ACEOF
#define SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON "$xkbcommon_lib"
_ACEOF

SUMMARY_video="${SUMMARY_video} mir(dynamic)"
else
enable_mir_shared=no
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $MIR_LIBS"
SUMMARY_video="${SUMMARY_video} mir"
fi
have_video=yes
fi
fi
}

CheckNativeClient()
{
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
Expand Down Expand Up @@ -24153,7 +24003,6 @@ case "$host" in
CheckOpenGLX11
CheckOpenGLESX11
CheckVulkan
CheckMir
CheckWayland
CheckLibUDev
CheckDBus
Expand Down
74 changes: 0 additions & 74 deletions configure.in
Expand Up @@ -1528,79 +1528,6 @@ AC_HELP_STRING([--enable-wayland-shared], [dynamically load Wayland support [[de
fi
}

dnl Check for Mir
CheckMir()
{
AC_ARG_ENABLE(video-mir,
AC_HELP_STRING([--enable-video-mir], [use Mir video driver [[default=no]]]),
,enable_video_mir=no)

if test x$enable_video = xyes -a x$enable_video_mir = xyes; then
AC_PATH_PROG(PKG_CONFIG, pkg-config, no)
AC_MSG_CHECKING(for Mir support)
video_mir=no
if test x$PKG_CONFIG != xno; then
if $PKG_CONFIG --exists mirclient egl xkbcommon ; then
MIR_CFLAGS=`$PKG_CONFIG --cflags mirclient egl xkbcommon`
MIR_LIBS=`$PKG_CONFIG --libs mirclient egl xkbcommon`
save_CFLAGS="$CFLAGS"
CFLAGS="$save_CFLAGS $MIR_CFLAGS"

dnl This will disable Mir if >= v0.26 is not available
AC_TRY_COMPILE([
#include <mir_toolkit/mir_client_library.h>
],[
MirWindowAttrib attrib = mir_window_attrib_state
],[
video_mir=yes
])
CFLAGS="$save_CFLAGS"
fi
fi
AC_MSG_RESULT($video_mir)

if test x$video_mir = xyes; then
AC_DEFINE(SDL_VIDEO_DRIVER_MIR, 1, [ ])
SOURCES="$SOURCES $srcdir/src/video/mir/*.c"
EXTRA_CFLAGS="$EXTRA_CFLAGS $MIR_CFLAGS"
AC_ARG_ENABLE(mir-shared,
AC_HELP_STRING([--enable-mir-shared], [dynamically load Mir support [[default=maybe]]]),
, enable_mir_shared=maybe)

dnl FIXME: Do BSD and OS X need special cases?
case "$host" in
*)
mirclient_lib=[`find_lib "libmirclient.so.*" "$MIR_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
xkbcommon_lib=[`find_lib "libxkbcommon.so.*" "$MIR_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`]
;;
esac

if test x$enable_mir_shared = xmaybe; then
enable_mir_shared=yes
fi
if test x$have_loadso != xyes && \
test x$enable_mir_shared = xyes; then
AC_MSG_WARN([You must have SDL_LoadObject() support for dynamic Mir loading])
enable_mir_shared=no
fi
if test x$have_loadso = xyes && \
test x$enable_mir_shared = xyes && \
test x$mirclient_lib != x && \
test x$xkbcommon_lib != x; then
echo "-- dynamic libmirclient -> $mirclient_lib"
echo "-- dynamic libxkbcommon -> $xkbcommon_lib"
AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_MIR_DYNAMIC, "$mirclient_lib", [ ])
AC_DEFINE_UNQUOTED(SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON, "$xkbcommon_lib", [ ])
SUMMARY_video="${SUMMARY_video} mir(dynamic)"
else
enable_mir_shared=no
EXTRA_LDFLAGS="$EXTRA_LDFLAGS $MIR_LIBS"
SUMMARY_video="${SUMMARY_video} mir"
fi
have_video=yes
fi
fi
}

dnl Check for Native Client stuff
CheckNativeClient()
Expand Down Expand Up @@ -3476,7 +3403,6 @@ case "$host" in
CheckOpenGLX11
CheckOpenGLESX11
CheckVulkan
CheckMir
CheckWayland
CheckLibUDev
CheckDBus
Expand Down
3 changes: 0 additions & 3 deletions docs/README-linux.md
Expand Up @@ -25,9 +25,6 @@ fcitx-libs-dev libsamplerate0-dev libsndio-dev
Ubuntu 16.04+ can also add "libwayland-dev libxkbcommon-dev wayland-protocols"
to that command line for Wayland support.

Ubuntu 16.10 can also add "libmirclient-dev libxkbcommon-dev" to that command
line for Mir support.

NOTES:
- This includes all the audio targets except arts, because Ubuntu pulled the
artsc0-dev package, but in theory SDL still supports it.
Expand Down
3 changes: 0 additions & 3 deletions include/SDL_config.h.cmake
Expand Up @@ -339,9 +339,6 @@
#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR@
#cmakedefine SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON @SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON@

#cmakedefine SDL_VIDEO_DRIVER_MIR @SDL_VIDEO_DRIVER_MIR@
#cmakedefine SDL_VIDEO_DRIVER_MIR_DYNAMIC @SDL_VIDEO_DRIVER_MIR_DYNAMIC@
#cmakedefine SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON @SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON@
#cmakedefine SDL_VIDEO_DRIVER_EMSCRIPTEN @SDL_VIDEO_DRIVER_EMSCRIPTEN@
#cmakedefine SDL_VIDEO_DRIVER_X11 @SDL_VIDEO_DRIVER_X11@
#cmakedefine SDL_VIDEO_DRIVER_X11_DYNAMIC @SDL_VIDEO_DRIVER_X11_DYNAMIC@
Expand Down
3 changes: 0 additions & 3 deletions include/SDL_config.h.in
Expand Up @@ -327,9 +327,6 @@
#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL
#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR
#undef SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON
#undef SDL_VIDEO_DRIVER_MIR
#undef SDL_VIDEO_DRIVER_MIR_DYNAMIC
#undef SDL_VIDEO_DRIVER_MIR_DYNAMIC_XKBCOMMON
#undef SDL_VIDEO_DRIVER_X11
#undef SDL_VIDEO_DRIVER_RPI
#undef SDL_VIDEO_DRIVER_KMSDRM
Expand Down
8 changes: 4 additions & 4 deletions include/SDL_syswm.h
Expand Up @@ -122,7 +122,7 @@ typedef enum
SDL_SYSWM_COCOA,
SDL_SYSWM_UIKIT,
SDL_SYSWM_WAYLAND,
SDL_SYSWM_MIR,
SDL_SYSWM_MIR, /* no longer available, left for API/ABI compatibility. Remove in 2.1! */
SDL_SYSWM_WINRT,
SDL_SYSWM_ANDROID,
SDL_SYSWM_VIVANTE,
Expand Down Expand Up @@ -257,11 +257,11 @@ struct SDL_SysWMinfo
struct wl_shell_surface *shell_surface; /**< Wayland shell_surface (window manager handle) */
} wl;
#endif
#if defined(SDL_VIDEO_DRIVER_MIR)
#if defined(SDL_VIDEO_DRIVER_MIR) /* no longer available, left for API/ABI compatibility. Remove in 2.1! */
struct
{
struct MirConnection *connection; /**< Mir display server connection */
struct MirSurface *surface; /**< Mir surface */
void *connection; /**< Mir display server connection */
void *surface; /**< Mir surface */
} mir;
#endif

Expand Down

0 comments on commit bc57ac2

Please sign in to comment.