Make EGL/GLESv2 dependencies optional
Introduce --disable-egl switch for configure to disable EGL/GLESv2 support. Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
This commit is contained in:
committed by
Kristian Høgsberg
parent
52cfd61cdb
commit
1bfe2e6f4b
+25
-15
@@ -33,9 +33,17 @@ AC_CHECK_HEADERS([execinfo.h])
|
|||||||
|
|
||||||
AC_CHECK_FUNCS([mkostemp strchrnul])
|
AC_CHECK_FUNCS([mkostemp strchrnul])
|
||||||
|
|
||||||
PKG_CHECK_MODULES(COMPOSITOR,
|
COMPOSITOR_MODULES="wayland-server xkbcommon pixman-1"
|
||||||
[wayland-server egl >= 7.10 glesv2 xkbcommon pixman-1])
|
|
||||||
|
|
||||||
|
AC_ARG_ENABLE(egl, [ --disable-egl],,
|
||||||
|
enable_egl=yes)
|
||||||
|
AM_CONDITIONAL(ENABLE_EGL, test x$enable_egl = xyes)
|
||||||
|
if test x$enable_egl = xyes; then
|
||||||
|
AC_DEFINE([ENABLE_EGL], [1], [Build Weston with EGL support])
|
||||||
|
COMPOSITOR_MODULES="$COMPOSITOR_MODULES egl >= 7.10 glesv2"
|
||||||
|
fi
|
||||||
|
|
||||||
|
PKG_CHECK_MODULES(COMPOSITOR, [$COMPOSITOR_MODULES])
|
||||||
|
|
||||||
AC_ARG_ENABLE(setuid-install, [ --enable-setuid-install],,
|
AC_ARG_ENABLE(setuid-install, [ --enable-setuid-install],,
|
||||||
enable_setuid_install=yes)
|
enable_setuid_install=yes)
|
||||||
@@ -94,8 +102,8 @@ fi
|
|||||||
|
|
||||||
AC_ARG_ENABLE(drm-compositor, [ --enable-drm-compositor],,
|
AC_ARG_ENABLE(drm-compositor, [ --enable-drm-compositor],,
|
||||||
enable_drm_compositor=yes)
|
enable_drm_compositor=yes)
|
||||||
AM_CONDITIONAL(ENABLE_DRM_COMPOSITOR, test x$enable_drm_compositor = xyes)
|
AM_CONDITIONAL(ENABLE_DRM_COMPOSITOR, test x$enable_drm_compositor = xyes -a x$enable_egl = xyes)
|
||||||
if test x$enable_drm_compositor = xyes; then
|
if test x$enable_drm_compositor = xyes -a x$enable_egl = xyes; then
|
||||||
AC_DEFINE([BUILD_DRM_COMPOSITOR], [1], [Build the DRM compositor])
|
AC_DEFINE([BUILD_DRM_COMPOSITOR], [1], [Build the DRM compositor])
|
||||||
PKG_CHECK_MODULES(DRM_COMPOSITOR, [libudev >= 136 libdrm >= 2.4.30 gbm mtdev >= 1.1.0])
|
PKG_CHECK_MODULES(DRM_COMPOSITOR, [libudev >= 136 libdrm >= 2.4.30 gbm mtdev >= 1.1.0])
|
||||||
fi
|
fi
|
||||||
@@ -104,8 +112,8 @@ fi
|
|||||||
AC_ARG_ENABLE(wayland-compositor, [ --enable-wayland-compositor],,
|
AC_ARG_ENABLE(wayland-compositor, [ --enable-wayland-compositor],,
|
||||||
enable_wayland_compositor=yes)
|
enable_wayland_compositor=yes)
|
||||||
AM_CONDITIONAL(ENABLE_WAYLAND_COMPOSITOR,
|
AM_CONDITIONAL(ENABLE_WAYLAND_COMPOSITOR,
|
||||||
test x$enable_wayland_compositor = xyes)
|
test x$enable_wayland_compositor = xyes -a x$enable_egl = xyes)
|
||||||
if test x$enable_wayland_compositor = xyes; then
|
if test x$enable_wayland_compositor = xyes -a x$enable_egl = xyes; then
|
||||||
AC_DEFINE([BUILD_WAYLAND_COMPOSITOR], [1],
|
AC_DEFINE([BUILD_WAYLAND_COMPOSITOR], [1],
|
||||||
[Build the Wayland (nested) compositor])
|
[Build the Wayland (nested) compositor])
|
||||||
PKG_CHECK_MODULES(WAYLAND_COMPOSITOR, [wayland-client wayland-egl])
|
PKG_CHECK_MODULES(WAYLAND_COMPOSITOR, [wayland-client wayland-egl])
|
||||||
@@ -122,8 +130,8 @@ AC_ARG_ENABLE(android-compositor,
|
|||||||
AS_HELP_STRING([--disable-android-compositor],
|
AS_HELP_STRING([--disable-android-compositor],
|
||||||
[do not build-test the Android 4.0 backend]),,
|
[do not build-test the Android 4.0 backend]),,
|
||||||
enable_android_compositor=yes)
|
enable_android_compositor=yes)
|
||||||
AM_CONDITIONAL(ENABLE_ANDROID_COMPOSITOR, test x$enable_android_compositor = xyes)
|
AM_CONDITIONAL(ENABLE_ANDROID_COMPOSITOR, test x$enable_android_compositor = xyes -a x$enable_egl = xyes)
|
||||||
if test x$enable_android_compositor = xyes; then
|
if test x$enable_android_compositor = xyes -a x$enable_egl = xyes; then
|
||||||
AC_DEFINE([BUILD_ANDROID_COMPOSITOR], [1], [Build the compositor for Android 4.0])
|
AC_DEFINE([BUILD_ANDROID_COMPOSITOR], [1], [Build the compositor for Android 4.0])
|
||||||
PKG_CHECK_MODULES(ANDROID_COMPOSITOR, [mtdev >= 1.1.0])
|
PKG_CHECK_MODULES(ANDROID_COMPOSITOR, [mtdev >= 1.1.0])
|
||||||
fi
|
fi
|
||||||
@@ -133,9 +141,9 @@ AC_ARG_ENABLE(rpi-compositor,
|
|||||||
AS_HELP_STRING([--disable-rpi-compositor],
|
AS_HELP_STRING([--disable-rpi-compositor],
|
||||||
[do not build the Raspberry Pi backend]),,
|
[do not build the Raspberry Pi backend]),,
|
||||||
enable_rpi_compositor=yes)
|
enable_rpi_compositor=yes)
|
||||||
AM_CONDITIONAL(ENABLE_RPI_COMPOSITOR, test "x$enable_rpi_compositor" = "xyes")
|
AM_CONDITIONAL(ENABLE_RPI_COMPOSITOR, test "x$enable_rpi_compositor" = "xyes" -a "x$enable_egl" = "xyes")
|
||||||
have_bcm_host="no"
|
have_bcm_host="no"
|
||||||
if test x$enable_rpi_compositor = xyes; then
|
if test x$enable_rpi_compositor = xyes -a x$enable_egl = xyes; then
|
||||||
AC_DEFINE([BUILD_RPI_COMPOSITOR], [1], [Build the compositor for Raspberry Pi])
|
AC_DEFINE([BUILD_RPI_COMPOSITOR], [1], [Build the compositor for Raspberry Pi])
|
||||||
PKG_CHECK_MODULES(RPI_COMPOSITOR, [libudev >= 136 mtdev >= 1.1.0])
|
PKG_CHECK_MODULES(RPI_COMPOSITOR, [libudev >= 136 mtdev >= 1.1.0])
|
||||||
PKG_CHECK_MODULES(RPI_BCM_HOST, [bcm_host],
|
PKG_CHECK_MODULES(RPI_BCM_HOST, [bcm_host],
|
||||||
@@ -185,8 +193,8 @@ AC_ARG_ENABLE(simple-egl-clients,
|
|||||||
AS_HELP_STRING([--disable-simple-egl-clients],
|
AS_HELP_STRING([--disable-simple-egl-clients],
|
||||||
[do not build the simple EGL clients]),,
|
[do not build the simple EGL clients]),,
|
||||||
enable_simple_egl_clients=yes)
|
enable_simple_egl_clients=yes)
|
||||||
AM_CONDITIONAL(BUILD_SIMPLE_EGL_CLIENTS, test "x$enable_simple_egl_clients" = "xyes")
|
AM_CONDITIONAL(BUILD_SIMPLE_EGL_CLIENTS, test "x$enable_simple_egl_clients" = "xyes" -a "x$enable_egl" = "xyes")
|
||||||
if test x$enable_simple_egl_clients = xyes; then
|
if test x$enable_simple_egl_clients = xyes -a x$enable_egl = xyes; then
|
||||||
PKG_CHECK_MODULES(SIMPLE_EGL_CLIENT,
|
PKG_CHECK_MODULES(SIMPLE_EGL_CLIENT,
|
||||||
[egl >= 7.10 glesv2 wayland-client wayland-egl wayland-cursor])
|
[egl >= 7.10 glesv2 wayland-client wayland-egl wayland-cursor])
|
||||||
fi
|
fi
|
||||||
@@ -224,14 +232,16 @@ if test x$enable_weston_launch == xyes; then
|
|||||||
WESTON_LAUNCH_LIBS="$WESTON_LAUNCH_LIBS -lpam"
|
WESTON_LAUNCH_LIBS="$WESTON_LAUNCH_LIBS -lpam"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
PKG_CHECK_MODULES(GLU, [glu], [have_glu=yes], [have_glu=no])
|
AM_CONDITIONAL(HAVE_GLU, test "x$have_glu" = "xyes" -a "$xenable_egl" = "xyes")
|
||||||
AM_CONDITIONAL(HAVE_GLU, test "x$have_glu" = "xyes")
|
if test x$enable_egl = xyes; then
|
||||||
|
PKG_CHECK_MODULES(GLU, [glu], [have_glu=yes], [have_glu=no])
|
||||||
|
fi
|
||||||
|
|
||||||
|
|
||||||
AM_CONDITIONAL(HAVE_POPPLER, test "x$have_poppler" = "xyes")
|
AM_CONDITIONAL(HAVE_POPPLER, test "x$have_poppler" = "xyes")
|
||||||
|
|
||||||
AM_CONDITIONAL(BUILD_FULL_GL_CLIENTS,
|
AM_CONDITIONAL(BUILD_FULL_GL_CLIENTS,
|
||||||
test x$cairo_modules = "xcairo-gl" -a "x$have_cairo_egl" = "xyes")
|
test x$cairo_modules = "xcairo-gl" -a "x$have_cairo_egl" = "xyes" -a "x$enable_egl" = "xyes")
|
||||||
|
|
||||||
AM_CONDITIONAL(ENABLE_DESKTOP_SHELL, true)
|
AM_CONDITIONAL(ENABLE_DESKTOP_SHELL, true)
|
||||||
|
|
||||||
|
|||||||
+5
-1
@@ -34,7 +34,6 @@ weston_SOURCES = \
|
|||||||
workspaces-server-protocol.h \
|
workspaces-server-protocol.h \
|
||||||
util.c \
|
util.c \
|
||||||
gl-renderer.h \
|
gl-renderer.h \
|
||||||
gl-renderer.c \
|
|
||||||
noop-renderer.c \
|
noop-renderer.c \
|
||||||
pixman-renderer.c \
|
pixman-renderer.c \
|
||||||
pixman-renderer.h \
|
pixman-renderer.h \
|
||||||
@@ -43,6 +42,11 @@ weston_SOURCES = \
|
|||||||
weston-launch.h \
|
weston-launch.h \
|
||||||
weston-egl-ext.h
|
weston-egl-ext.h
|
||||||
|
|
||||||
|
if ENABLE_EGL
|
||||||
|
weston_SOURCES += \
|
||||||
|
gl-renderer.c
|
||||||
|
endif
|
||||||
|
|
||||||
git-version.h : .FORCE
|
git-version.h : .FORCE
|
||||||
$(AM_V_GEN)(echo "#define BUILD_ID \"$(shell git --work-tree=$(top_srcdir) describe --always --dirty) $(shell git --work-tree=$(top_srcdir) log -1 --format='%s (%ci)')\"" > $@-new; \
|
$(AM_V_GEN)(echo "#define BUILD_ID \"$(shell git --work-tree=$(top_srcdir) describe --always --dirty) $(shell git --work-tree=$(top_srcdir) log -1 --format='%s (%ci)')\"" > $@-new; \
|
||||||
cmp -s $@ $@-new || cp $@-new $@; \
|
cmp -s $@ $@-new || cp $@-new $@; \
|
||||||
|
|||||||
@@ -884,7 +884,7 @@ x11_compositor_create_output(struct x11_compositor *c, int x, int y,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (gl_renderer_output_create(&output->base, output->window) < 0)
|
if (gl_renderer_output_create(&output->base, (EGLNativeWindowType)output->window) < 0)
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1474,7 +1474,7 @@ x11_compositor_create(struct wl_display *display,
|
|||||||
goto err_xdisplay;
|
goto err_xdisplay;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (gl_renderer_create(&c->base, c->dpy, gl_renderer_opaque_attribs,
|
if (gl_renderer_create(&c->base, (EGLNativeDisplayType)c->dpy, gl_renderer_opaque_attribs,
|
||||||
NULL) < 0)
|
NULL) < 0)
|
||||||
goto err_xdisplay;
|
goto err_xdisplay;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -20,8 +20,13 @@
|
|||||||
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
#include <config.h>
|
||||||
|
#endif
|
||||||
#include "compositor.h"
|
#include "compositor.h"
|
||||||
|
|
||||||
|
#ifdef ENABLE_EGL
|
||||||
|
|
||||||
#include <EGL/egl.h>
|
#include <EGL/egl.h>
|
||||||
|
|
||||||
extern const EGLint gl_renderer_opaque_attribs[];
|
extern const EGLint gl_renderer_opaque_attribs[];
|
||||||
@@ -45,3 +50,57 @@ gl_renderer_set_border(struct weston_compositor *ec, int32_t width, int32_t heig
|
|||||||
|
|
||||||
void
|
void
|
||||||
gl_renderer_print_egl_error_state(void);
|
gl_renderer_print_egl_error_state(void);
|
||||||
|
#else
|
||||||
|
|
||||||
|
typedef int EGLint;
|
||||||
|
typedef int EGLDisplay;
|
||||||
|
typedef int EGLSurface;
|
||||||
|
typedef long int EGLNativeDisplayType;
|
||||||
|
typedef long int EGLNativeWindowType;
|
||||||
|
|
||||||
|
static const EGLint gl_renderer_opaque_attribs[];
|
||||||
|
static const EGLint gl_renderer_alpha_attribs[];
|
||||||
|
|
||||||
|
inline static int
|
||||||
|
gl_renderer_create(struct weston_compositor *ec, EGLNativeDisplayType display,
|
||||||
|
const EGLint *attribs, const EGLint *visual_id)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline static EGLDisplay
|
||||||
|
gl_renderer_display(struct weston_compositor *ec)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline static int
|
||||||
|
gl_renderer_output_create(struct weston_output *output,
|
||||||
|
EGLNativeWindowType window)
|
||||||
|
{
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline static void
|
||||||
|
gl_renderer_output_destroy(struct weston_output *output)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
inline static EGLSurface
|
||||||
|
gl_renderer_output_surface(struct weston_output *output)
|
||||||
|
{
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
inline static void
|
||||||
|
gl_renderer_set_border(struct weston_compositor *ec, int32_t width, int32_t height, void *data,
|
||||||
|
int32_t *edges)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
inline static void
|
||||||
|
gl_renderer_print_egl_error_state(void)
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user