configure
changeset 8104 2e4f1bd21196
parent 8091 a65f28a04224
child 8124 5226058345bf
     1.1 --- a/configure	Wed Jan 08 14:53:08 2014 -0500
     1.2 +++ b/configure	Thu Jan 09 13:56:21 2014 -0300
     1.3 @@ -819,6 +819,7 @@
     1.4  enable_dummyaudio
     1.5  enable_video_wayland
     1.6  enable_video_wayland_qt_touch
     1.7 +enable_wayland_shared
     1.8  enable_video_x11
     1.9  with_x
    1.10  enable_x11_shared
    1.11 @@ -1538,6 +1539,7 @@
    1.12    --enable-video-wayland-qt-touch
    1.13                            QtWayland server support for Wayland video driver
    1.14                            [[default=yes]]
    1.15 +  --enable-wayland-shared dynamically load Wayland support [[default=maybe]]
    1.16    --enable-video-x11      use X11 video driver [[default=yes]]
    1.17    --enable-x11-shared     dynamically load X11 support [[default=maybe]]
    1.18    --enable-video-x11-xcursor
    1.19 @@ -18705,8 +18707,8 @@
    1.20          video_wayland=no
    1.21          if test x$PKG_CONFIG != xno; then
    1.22              if $PKG_CONFIG --exists wayland-client wayland-egl wayland-cursor egl xkbcommon ; then
    1.23 -                WAYLAND_CFLAGS=`$PKG_CONFIG --cflags wayland-client wayland-egl wayland-cursor egl xkbcommon`
    1.24 -                WAYLAND_LIBS=`$PKG_CONFIG --libs wayland-client wayland-egl wayland-cursor egl xkbcommon`
    1.25 +                WAYLAND_CFLAGS=`$PKG_CONFIG --cflags wayland-client wayland-egl wayland-cursor xkbcommon`
    1.26 +                WAYLAND_LIBS=`$PKG_CONFIG --libs wayland-client wayland-egl wayland-cursor xkbcommon`
    1.27                  video_wayland=yes
    1.28              fi
    1.29          fi
    1.30 @@ -18724,7 +18726,69 @@
    1.31              fi
    1.32              SOURCES="$SOURCES $srcdir/src/video/wayland/*.c"
    1.33              EXTRA_CFLAGS="$EXTRA_CFLAGS $WAYLAND_CFLAGS"
    1.34 -                        EXTRA_LDFLAGS="$EXTRA_LDFLAGS $WAYLAND_LIBS"
    1.35 +            # Check whether --enable-wayland-shared was given.
    1.36 +if test "${enable_wayland_shared+set}" = set; then :
    1.37 +  enableval=$enable_wayland_shared;
    1.38 +else
    1.39 +  enable_wayland_shared=maybe
    1.40 +fi
    1.41 +
    1.42 +
    1.43 +                        case "$host" in
    1.44 +                *)
    1.45 +                    wayland_client_lib=`find_lib "libwayland-client.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`
    1.46 +                    wayland_egl_lib=`find_lib "libwayland-egl.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`
    1.47 +                    if test x$wayland_egl_lib = x; then
    1.48 +                                                wayland_egl_lib=`find_lib "mesa-egl/libwayland-egl.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`
    1.49 +                    fi
    1.50 +                    wayland_cursor_lib=`find_lib "libwayland-cursor.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`
    1.51 +                    xkbcommon_lib=`find_lib "libxkbcommon.so.*" "$WAYLAND_LIBS" | sed 's/.*\/\(.*\)/\1/; q'`
    1.52 +                    ;;
    1.53 +            esac
    1.54 +
    1.55 +            if test x$enable_wayland_shared = xmaybe; then
    1.56 +                enable_wayland_shared=yes
    1.57 +            fi
    1.58 +            if test x$have_loadso != xyes && \
    1.59 +               test x$enable_wayland_shared = xyes; then
    1.60 +                { $as_echo "$as_me:${as_lineno-$LINENO}: WARNING: You must have SDL_LoadObject() support for dynamic WAYLAND loading" >&5
    1.61 +$as_echo "$as_me: WARNING: You must have SDL_LoadObject() support for dynamic WAYLAND loading" >&2;}
    1.62 +                enable_wayland_shared=no
    1.63 +            fi
    1.64 +            if test x$have_loadso = xyes && \
    1.65 +               test x$enable_wayland_shared = xyes && \
    1.66 +               test x$wayland_client_lib != x && \
    1.67 +               test x$wayland_egl_lib != x && \
    1.68 +               test x$wayland_cursor_lib != x && \
    1.69 +               test x$xkbcommon_lib != x; then
    1.70 +                echo "-- dynamic libwayland-client -> $wayland_client_lib"
    1.71 +                echo "-- dynamic libwayland-egl -> $wayland_egl_lib"
    1.72 +                echo "-- dynamic libwayland-cursor -> $wayland_cursor_lib"
    1.73 +                echo "-- dynamic xkbcommon -> $xkbcommon_lib"
    1.74 +
    1.75 +cat >>confdefs.h <<_ACEOF
    1.76 +#define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC "$wayland_client_lib"
    1.77 +_ACEOF
    1.78 +
    1.79 +
    1.80 +cat >>confdefs.h <<_ACEOF
    1.81 +#define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_EGL "$wayland_egl_lib"
    1.82 +_ACEOF
    1.83 +
    1.84 +
    1.85 +cat >>confdefs.h <<_ACEOF
    1.86 +#define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_CURSOR "$wayland_cursor_lib"
    1.87 +_ACEOF
    1.88 +
    1.89 +
    1.90 +cat >>confdefs.h <<_ACEOF
    1.91 +#define SDL_VIDEO_DRIVER_WAYLAND_DYNAMIC_XKBCOMMON "$xkbcommon_lib"
    1.92 +_ACEOF
    1.93 +
    1.94 +            else
    1.95 +                enable_wayland_shared=no
    1.96 +                EXTRA_LDFLAGS="$EXTRA_LDFLAGS $WAYLAND_LIBS"
    1.97 +            fi
    1.98              have_video=yes
    1.99          fi
   1.100      fi