[clutter/multi-backend: 3/22] Implement multi-backend support
- From: Emmanuele Bassi <ebassi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [clutter/multi-backend: 3/22] Implement multi-backend support
- Date: Mon, 24 Oct 2011 14:02:50 +0000 (UTC)
commit 3f108fef8577f621bbd8510da2d6b71531145301
Author: Emmanuele Bassi <ebassi linux intel com>
Date: Wed Sep 21 18:05:03 2011 +0100
Implement multi-backend support
The Clutter backend split is opaque enough that should allow us to just
build all possible backends inside the same shared object, and select
the wanted backend at initialization time.
This requires some work in the build system, as well as the
initialization code, to remove duplicate functions that might cause
conflicts at build and link time. We also need to defer all the checks
of the internal state of the platform-specific API to run-time type
checks.
clutter/Makefile.am | 139 ++++++---
clutter/clutter-backend-private.h | 3 -
clutter/clutter-main.c | 63 ++++-
clutter/clutter-version.h.in | 14 +
clutter/clutter.pc.in | 11 +-
clutter/cogl/clutter-stage-cogl.c | 19 +-
clutter/egl/clutter-backend-eglnative.c | 55 ++--
clutter/gdk/clutter-backend-gdk.c | 16 +-
clutter/gdk/clutter-gdk.h | 13 +-
clutter/gdk/clutter-stage-gdk.c | 14 +-
clutter/osx/clutter-backend-osx.c | 6 -
clutter/wayland/clutter-backend-wayland.c | 6 -
clutter/win32/clutter-backend-win32.c | 6 -
clutter/win32/clutter-stage-win32.c | 10 +-
clutter/x11/clutter-backend-x11.c | 78 ++++--
clutter/x11/clutter-x11-texture-pixmap.c | 25 +-
configure.ac | 482 ++++++++++++++---------------
doc/cookbook/examples/Makefile.am | 2 +-
doc/reference/cally/Makefile.am | 2 +-
doc/reference/clutter/Makefile.am | 2 +-
tests/accessibility/Makefile.am | 2 +-
tests/conform/Makefile.am | 2 +-
tests/interactive/Makefile.am | 2 +-
tests/micro-bench/Makefile.am | 2 +-
tests/performance/Makefile.am | 2 +-
25 files changed, 578 insertions(+), 398 deletions(-)
---
diff --git a/clutter/Makefile.am b/clutter/Makefile.am
index a88dac0..ed8f741 100644
--- a/clutter/Makefile.am
+++ b/clutter/Makefile.am
@@ -14,8 +14,6 @@ lib_LTLIBRARIES =
INCLUDES = \
-I$(top_srcdir) \
-I$(top_srcdir)/clutter \
- -I$(top_srcdir)/clutter/$(CLUTTER_WINSYS) \
- -I$(top_srcdir)/clutter/$(CLUTTER_WINSYS_BASE) \
-I$(top_srcdir)/clutter/deprecated \
-I$(top_srcdir)/clutter/cally \
-I$(top_builddir) \
@@ -298,6 +296,13 @@ EXTRA_DIST += clutter-keysyms-update.pl
pc_files += clutter-$(CLUTTER_API_VERSION).pc
+# in order to be compatible with Clutter < 1.10, when we shipped a single
+# shared library whose name was determined by the single backend it
+# supported, we need to install symbolic links so that existing applications
+# using Clutter won't break in the Brave New World of multi-backend support
+# in the same shared object.
+compat_libs =
+
# backends source listings
#
# backend_source_c := source code
@@ -367,6 +372,11 @@ x11_introspection = $(x11_source_c) $(x11_source_h)
clutterx11_includedir = $(clutter_includedir)/x11
clutterx11_include_HEADERS = $(x11_source_h)
+
+clutter-x11-$(CLUTTER_API_VERSION).pc: clutter-$(CLUTTER_API_VERSION).pc
+ $(QUIET_GEN)cp -f $< $(@F)
+
+pc_files += clutter-x11-$(CLUTTER_API_VERSION).pc
endif # SUPPORT_X11
# Shared cogl backend files
@@ -384,20 +394,31 @@ cogl_source_h_priv = \
cogl_source_c_priv =
+if USE_COGL
+backend_source_h += $(cogl_source_h)
+backend_source_c += $(cogl_source_c)
+backend_source_h_priv += $(cogl_source_h_priv)
+backend_source_c_priv += $(cogl_source_c_priv)
+
# pkg-config file for the cogl meta-backend
clutter-cogl-$(CLUTTER_API_VERSION).pc: clutter-$(CLUTTER_API_VERSION).pc
$(QUIET_GEN)cp -f $< $(@F)
pc_files += clutter-cogl-$(CLUTTER_API_VERSION).pc
+endif
-if SUPPORT_X11
-# For compatability with the old GLX backend
+# For compatibility with the old GLX backend
#
# Note: there wasn't actually anything GLX specific so we can add
-# the compatability if clutter supports x11
-backend_source_c += $(srcdir)/x11/clutter-glx-texture-pixmap.c
+# the compatibility if clutter supports x11
+glx_source_c = $(srcdir)/x11/clutter-glx-texture-pixmap.c
glx_source_h = $(srcdir)/x11/clutter-glx-texture-pixmap.h \
$(srcdir)/x11/clutter-glx.h
+
+if SUPPORT_X11
+backend_source_h += $(glx_source_h)
+backend_source_c += $(glx_source_c)
+
clutterglx_includedir = $(clutter_includedir)/glx
clutterglx_include_HEADERS = $(glx_source_h)
@@ -405,13 +426,9 @@ clutter-glx-$(CLUTTER_API_VERSION).pc: clutter-$(CLUTTER_API_VERSION).pc
$(QUIET_GEN)cp -f $< $(@F)
pc_files += clutter-glx-$(CLUTTER_API_VERSION).pc
-endif
-if SUPPORT_GLX
-backend_source_h += $(cogl_source_h) $(glx_source_h)
-backend_source_c += $(cogl_source_c) $(glx_source_c)
-backend_source_h_priv += $(cogl_source_h_priv)
-endif # SUPPORT_GLX
+compat_libs += libclutter-glx-$(CLUTTER_API_VERSION).so.0
+endif
# GDK backend rules
gdk_source_c = \
@@ -436,12 +453,19 @@ gdk_source_h_priv = \
$(NULL)
if SUPPORT_GDK
-backend_source_h += $(cogl_source_h) $(gdk_source_h)
-backend_source_c += $(cogl_source_c) $(gdk_source_c)
-backend_source_h_priv += $(cogl_source_h_priv) $(gdk_source_h_priv)
+backend_source_h += $(gdk_source_h)
+backend_source_c += $(gdk_source_c)
+backend_source_h_priv += $(gdk_source_h_priv)
cluttergdk_includedir = $(clutter_includedir)/gdk
cluttergdk_include_HEADERS = $(gdk_source_h)
+
+clutter-gdk-$(CLUTTER_API_VERSION).pc: clutter-$(CLUTTER_API_VERSION).pc
+ $(QUIET_GEN)cp -f $< $(@F)
+
+pc_files += clutter-gdk-$(CLUTTER_API_VERSION).pc
+
+gdk_introspection = $(gdk_source_c) $(gdk_source_h)
endif # SUPPORT_GDK
# Windows backend rules
@@ -483,6 +507,11 @@ backend_source_h_priv += $(win32_source_h_priv)
clutterwin_includedir = $(clutter_includedir)/win32
clutterwin_include_HEADERS = $(win32_source_h)
+
+clutter-win32-$(CLUTTER_API_VERSION).pc: clutter-$(CLUTTER_API_VERSION).pc
+ $(QUIET_GEN)cp -f $< $(@F)
+
+pc_files += clutter-win32-$(CLUTTER_API_VERSION).pc
endif # SUPPORT_WIN32
EXTRA_DIST += \
@@ -517,23 +546,32 @@ if USE_TSLIB
backend_source_c_priv += $(egl_tslib_c)
endif # SUPPORT_TSLIB
-if SUPPORT_EVDEV
+if USE_EVDEV
backend_source_c_priv += $(evdev_c_priv)
backend_source_h_priv += $(evdev_h_priv)
endif # SUPPORT_EVDEV
if SUPPORT_CEX100
backend_source_h += $(cex_h)
+
+clutter-cex100-$(CLUTTER_API_VERSION).pc: clutter-$(CLUTTER_API_VERSION).pc
+ $(QUIET_GEN)cp -f $< $(@F)
+
+pc_files += clutter-cex100-$(CLUTTER_API_VERSION).pc
+
+compat_libs += libclutter-cex100-$(CLUTTER_API_VERSION).so.0
endif # SUPPORT_CEX100
if SUPPORT_EGL
-backend_source_h += $(cogl_source_h) $(egl_source_h)
-backend_source_c += $(cogl_source_c)
-backend_source_h_priv += $(cogl_source_h_priv)
-backend_source_c_priv += $(cogl_source_c_priv)
+backend_source_h += $(egl_source_h)
clutteregl_includedir = $(clutter_includedir)/egl
clutteregl_include_HEADERS = $(egl_source_h)
+
+clutter-egl-$(CLUTTER_API_VERSION).pc: clutter-$(CLUTTER_API_VERSION).pc
+ $(QUIET_GEN)cp -f $< $(@F)
+
+pc_files += clutter-egl-$(CLUTTER_API_VERSION).pc
endif # SUPPORT_EGL
# OSX backend rules
@@ -569,6 +607,11 @@ backend_source_c_priv += $(osx_source_c_priv)
clutterosx_includedir = $(clutter_includedir)/osx
clutterosx_include_HEADERS = $(osx_source_h)
+
+clutter-osx-$(CLUTTER_API_VERSION).pc: clutter-$(CLUTTER_API_VERSION).pc
+ $(QUIET_GEN)cp -f $< $(@F)
+
+pc_files += clutter-osx-$(CLUTTER_API_VERSION).pc
endif # SUPPORT_OSX
# Wayland backend rules
@@ -590,6 +633,13 @@ backend_source_c += \
clutterwayland_includedir = $(clutter_includedir)/wayland
clutterwayland_include_HEADERS = $(wayland_source_h)
+
+clutter-wayland-$(CLUTTER_API_VERSION).pc: clutter-$(CLUTTER_API_VERSION).pc
+ $(QUIET_GEN)cp -f $< $(@F)
+
+pc_files += clutter-wayland-$(CLUTTER_API_VERSION).pc
+
+compat_libs += libclutter-wayland-$(CLUTTER_API_VERSION).so.0
endif # SUPPORT_WAYLAND
# cally
@@ -645,12 +695,6 @@ glib_enum_c = clutter-enum-types.c
glib_enum_headers = $(source_h) $(backend_source_h)
include $(top_srcdir)/build/autotools/Makefile.am.enums
-# backend-specific pkg-config file
-clutter-$(CLUTTER_WINSYS)-$(CLUTTER_API_VERSION).pc: clutter-$(CLUTTER_API_VERSION).pc
- $(QUIET_GEN)cp -f $< $(@F)
-
-pc_files += clutter-$(CLUTTER_WINSYS)-$(CLUTTER_API_VERSION).pc
-
pkgconfigdir = $(libdir)/pkgconfig
pkgconfig_DATA = $(pc_files)
DISTCLEANFILES += $(pc_files)
@@ -663,17 +707,17 @@ nodist_clutter_include_HEADERS = \
clutter_deprecated_HEADERS = $(deprecated_h)
-lib_LTLIBRARIES += libclutter- CLUTTER_SONAME_INFIX@- CLUTTER_API_VERSION@.la
+lib_LTLIBRARIES += libclutter- CLUTTER_API_VERSION@.la
-libclutter_ CLUTTER_SONAME_INFIX@_ CLUTTER_API_VERSION@_la_LIBADD = \
+libclutter_ CLUTTER_API_VERSION@_la_LIBADD = \
-lm \
$(CLUTTER_LIBS) \
$(CLUTTER_PROFILE_LIBS)
-libclutter_ CLUTTER_SONAME_INFIX@_ CLUTTER_API_VERSION@_la_DEPENDENCIES = \
+libclutter_ CLUTTER_API_VERSION@_la_DEPENDENCIES = \
$(win32_resources)
-libclutter_ CLUTTER_SONAME_INFIX@_ CLUTTER_API_VERSION@_la_SOURCES = \
+libclutter_ CLUTTER_API_VERSION@_la_SOURCES = \
$(backend_source_c) \
$(backend_source_h) \
$(backend_source_c_priv) \
@@ -691,12 +735,12 @@ libclutter_ CLUTTER_SONAME_INFIX@_ CLUTTER_API_VERSION@_la_SOURCES = \
$(cally_sources_private) \
$(NULL)
-nodist_libclutter_ CLUTTER_SONAME_INFIX@_ CLUTTER_API_VERSION@_la_SOURCES = \
+nodist_libclutter_ CLUTTER_API_VERSION@_la_SOURCES = \
$(backend_source_built) \
$(built_source_c) \
$(built_source_h)
-libclutter_ CLUTTER_SONAME_INFIX@_ CLUTTER_API_VERSION@_la_LDFLAGS = \
+libclutter_ CLUTTER_API_VERSION@_la_LDFLAGS = \
$(CLUTTER_LINK_FLAGS) \
$(CLUTTER_LT_LDFLAGS) \
$(GCOV_LDFLAGS) \
@@ -706,15 +750,21 @@ libclutter_ CLUTTER_SONAME_INFIX@_ CLUTTER_API_VERSION@_la_LDFLAGS = \
$(win32_resources_ldflag) \
$(NULL)
+install-exec-local:
+ for lib in "$(compat_libs)"; do \
+ rm -f $(DESTDIR)$(libdir)/$$lib ; \
+ ln -s libclutter-$(CLUTTER_API_VERSION).so.0.$(CLUTTER_LT_CURRENT).$(CLUTTER_LT_REVISION) $(DESTDIR)$(libdir)/$$lib ; \
+ done
+
# gobject-introspection rules
-include $(INTROSPECTION_MAKEFILE)
if HAVE_INTROSPECTION
-Clutter- CLUTTER_API_VERSION@.gir: libclutter- CLUTTER_SONAME_INFIX@- CLUTTER_API_VERSION@.la Makefile
+Clutter- CLUTTER_API_VERSION@.gir: libclutter- CLUTTER_API_VERSION@.la Makefile
Clutter_ CLUTTER_API_VERSION_AM@_gir_NAMESPACE = Clutter
Clutter_ CLUTTER_API_VERSION_AM@_gir_VERSION = @CLUTTER_API_VERSION@
-Clutter_ CLUTTER_API_VERSION_AM@_gir_LIBS = libclutter- CLUTTER_SONAME_INFIX@- CLUTTER_API_VERSION@.la
+Clutter_ CLUTTER_API_VERSION_AM@_gir_LIBS = libclutter- CLUTTER_API_VERSION@.la
Clutter_ CLUTTER_API_VERSION_AM@_gir_FILES = \
$(clutter_include_HEADERS) \
$(clutter_deprecated_HEADERS) \
@@ -735,7 +785,7 @@ Cally- CLUTTER_API_VERSION@.gir: Makefile Clutter- CLUTTER_API_VERSION@.gir
Cally_ CLUTTER_API_VERSION_AM@_gir_NAMESPACE = Cally
Cally_ CLUTTER_API_VERSION_AM@_gir_VERSION = @CLUTTER_API_VERSION@
-Cally_ CLUTTER_API_VERSION_AM@_gir_LIBS = libclutter- CLUTTER_SONAME_INFIX@- CLUTTER_API_VERSION@.la
+Cally_ CLUTTER_API_VERSION_AM@_gir_LIBS = libclutter- CLUTTER_API_VERSION@.la
Cally_ CLUTTER_API_VERSION_AM@_gir_FILES = $(cally_sources_h) $(cally_sources_c)
Cally_ CLUTTER_API_VERSION_AM@_gir_CFLAGS = $(INCLUDES) $(CLUTTER_CFLAGS) $(AM_CPPFLAGS) -UCLUTTER_DISABLE_DEPRECATED
Cally_ CLUTTER_API_VERSION_AM@_gir_SCANNERFLAGS = \
@@ -757,13 +807,30 @@ ClutterX11_ CLUTTER_API_VERSION_AM@_gir_SCANNERFLAGS = \
--pkg-export=clutter-x11- CLUTTER_API_VERSION@ \
--include-uninstalled=$(top_builddir)/clutter/Clutter- CLUTTER_API_VERSION@.gir
ClutterX11_ CLUTTER_API_VERSION_AM@_gir_INCLUDES = xlib-2.0
-ClutterX11_ CLUTTER_API_VERSION_AM@_gir_LIBS = libclutter- CLUTTER_SONAME_INFIX@- CLUTTER_API_VERSION@.la
+ClutterX11_ CLUTTER_API_VERSION_AM@_gir_LIBS = libclutter- CLUTTER_API_VERSION@.la
ClutterX11_ CLUTTER_API_VERSION_AM@_gir_FILES = $(x11_introspection)
ClutterX11_ CLUTTER_API_VERSION_AM@_gir_CFLAGS = $(INCLUDES) $(CLUTTER_CFLAGS) $(AM_CPPFLAGS) -UCLUTTER_DISABLE_DEPRECATED
INTROSPECTION_GIRS += ClutterX11- CLUTTER_API_VERSION@.gir
endif # SUPPORT_X11
+if SUPPORT_GDK
+ClutterGdk- CLUTTER_API_VERSION@.gir: Makefile Clutter- CLUTTER_API_VERSION@.gir
+
+ClutterGdk_ CLUTTER_API_VERSION_AM@_gir_SCANNERFLAGS = \
+ --identifier-prefix=ClutterGdk \
+ --symbol-prefix=clutter_gdk \
+ --c-include='clutter/gdk/clutter-gdk.h' \
+ --pkg-export=clutter-gdk- CLUTTER_API_VERSION@ \
+ --include-uninstalled=$(top_builddir)/clutter/Clutter- CLUTTER_API_VERSION@.gir
+ClutterGdk_ CLUTTER_API_VERSION_AM@_gir_INCLUDES = Gdk-3.0
+ClutterGdk_ CLUTTER_API_VERSION_AM@_gir_LIBS = libclutter- CLUTTER_API_VERSION@.la
+ClutterGdk_ CLUTTER_API_VERSION_AM@_gir_FILES = $(gdk_introspection)
+ClutterGdk_ CLUTTER_API_VERSION_AM@_gir_CFLAGS = $(INCLUDES) $(CLUTTER_CFLAGS) $(AM_CPPFLAGS) -UCLUTTER_DISABLE_DEPRECATED
+
+INTROSPECTION_GIRS += ClutterGdk- CLUTTER_API_VERSION@.gir
+endif # SUPPORT_GDK
+
# INTROSPECTION_GIRDIR/INTROSPECTION_TYPELIBDIR aren't the right place to
# install anything - we need to install inside our prefix.
girdir = $(datadir)/gir-1.0
diff --git a/clutter/clutter-backend-private.h b/clutter/clutter-backend-private.h
index 3374bbc..be7b58f 100644
--- a/clutter/clutter-backend-private.h
+++ b/clutter/clutter-backend-private.h
@@ -87,9 +87,6 @@ struct _ClutterBackendClass
void (* settings_changed) (ClutterBackend *backend);
};
-/* vfuncs implemented by backend */
-GType _clutter_backend_impl_get_type (void);
-
void _clutter_backend_redraw (ClutterBackend *backend,
ClutterStage *stage);
ClutterStageWindow *_clutter_backend_create_stage (ClutterBackend *backend,
diff --git a/clutter/clutter-main.c b/clutter/clutter-main.c
index f350253..25bde8e 100644
--- a/clutter/clutter-main.c
+++ b/clutter/clutter-main.c
@@ -100,6 +100,7 @@
#include "clutter-actor.h"
#include "clutter-backend-private.h"
+#include "clutter-config.h"
#include "clutter-debug.h"
#include "clutter-device-manager-private.h"
#include "clutter-event.h"
@@ -114,6 +115,25 @@
#include "clutter-stage-private.h"
#include "clutter-version.h" /* For flavour define */
+#ifdef CLUTTER_WINDOWING_OSX
+#include "osx/clutter-backend-osx.h"
+#endif
+#ifdef CLUTTER_WINDOWING_WIN32
+#include "win32/clutter-backend-win32.h"
+#endif
+#ifdef CLUTTER_WINDOWING_GDK
+#include "gdk/clutter-backend-gdk.h"
+#endif
+#ifdef CLUTTER_WINDOWING_X11
+#include "x11/clutter-backend-x11.h"
+#endif
+#ifdef CLUTTER_WINDOWING_EGL
+#include "egl/clutter-backend-eglnative.h"
+#endif
+#ifdef CLUTTER_WINDOWING_WAYLAND
+#include "wayland/clutter-backend-wayland.h"
+#endif
+
#include <cogl/cogl.h>
#include <cogl-pango/cogl-pango.h>
@@ -1293,11 +1313,46 @@ clutter_context_get_default_unlocked (void)
if (G_UNLIKELY (ClutterCntx == NULL))
{
ClutterMainContext *ctx;
+ const char *backend;
ClutterCntx = ctx = g_new0 (ClutterMainContext, 1);
- /* create the default backend */
- ctx->backend = g_object_new (_clutter_backend_impl_get_type (), NULL);
+ backend = g_getenv ("CLUTTER_BACKEND");
+
+#ifdef CLUTTER_WINDOWING_OSX
+ if (backend == NULL || strcmp (backend, "osx") == 0)
+ ctx->backend = g_object_new (CLUTTER_TYPE_BACKEND_OSX, NULL);
+ else
+#endif
+#ifdef CLUTTER_WINDOWING_WIN32
+ if (backend == NULL || strcmp (backend, "win32") == 0)
+ ctx->backend = g_object_new (CLUTTER_TYPE_BACKEND_WIN32, NULL);
+ else
+#endif
+#ifdef CLUTTER_WINDOWING_WAYLAND
+ if (backend == NULL || strcmp (backend, "wayland") == 0)
+ ctx->backend = g_object_new (CLUTTER_TYPE_BACKEND_WAYLAND, NULL);
+ else
+#endif
+#ifdef CLUTTER_WINDOWING_EGL
+ if (backend == NULL || strcmp (backend, "eglnative") == 0)
+ ctx->backend = g_object_new (CLUTTER_TYPE_BACKEND_EGLNATIVE, NULL);
+ else
+#endif
+#ifdef CLUTTER_WINDOWING_X11
+ if (backend == NULL || strcmp (backend, "x11") == 0)
+ ctx->backend = g_object_new (CLUTTER_TYPE_BACKEND_X11, NULL);
+ else
+#endif
+#ifdef CLUTTER_WINDOWING_GDK
+ if (backend == NULL || strcmp (backend, "gdk") == 0)
+ ctx->backend = g_object_new (CLUTTER_TYPE_BACKEND_GDK, NULL);
+ else
+#endif
+ if (backend != NULL)
+ g_error ("Unsupported Clutter backend: '%s'", backend);
+ else
+ g_error ("No default Clutter backend found.");
ctx->is_initialized = FALSE;
ctx->motion_events_per_actor = TRUE;
@@ -1314,6 +1369,10 @@ clutter_context_get_default_unlocked (void)
#endif
ctx->last_repaint_id = 1;
+
+ CLUTTER_NOTE (BACKEND, "Backend type: '%s' (requested: '%s')",
+ G_OBJECT_TYPE_NAME (ctx->backend),
+ backend != NULL ? backend : "<default>");
}
return ClutterCntx;
diff --git a/clutter/clutter-version.h.in b/clutter/clutter-version.h.in
index 73df000..835e29f 100644
--- a/clutter/clutter-version.h.in
+++ b/clutter/clutter-version.h.in
@@ -103,6 +103,12 @@ G_BEGIN_DECLS
* GL Windowing system used
*
* Since: 0.4
+ *
+ * Deprecated: 1.10: The macro evaluates to "deprecated" as Clutter can be
+ * compiled with multiple windowing system backends. Use the various
+ * CLUTTER_WINDOWING_* macros to detect the windowing system that Clutter
+ * is being compiled against, and the type check macros for the
+ * #ClutterBackend for a run-time check.
*/
#define CLUTTER_FLAVOUR "@CLUTTER_FLAVOUR@"
@@ -113,6 +119,9 @@ G_BEGIN_DECLS
* "gles" currently
*
* Since: 0.4
+ *
+ * Deprecated: 1.10: The macro evaluates to "deprecated" as Cogl can be
+ * compiled against multiple GL implementations.
*/
#define CLUTTER_COGL "@CLUTTER_COGL@"
@@ -122,6 +131,11 @@ G_BEGIN_DECLS
* The default GObject type for the Clutter stage.
*
* Since: 0.8
+ *
+ * Deprecated: 1.10: The macro evaluates to "deprecated" as Clutter can
+ * be compiled against multiple windowing systems. You can use the
+ * CLUTTER_WINDOWING_* macros for compile-time checks, and the type
+ * check macros for run-time checks.
*/
#define CLUTTER_STAGE_TYPE @CLUTTER_STAGE_TYPE@
diff --git a/clutter/clutter.pc.in b/clutter/clutter.pc.in
index 4a5afe9..0abf62f 100644
--- a/clutter/clutter.pc.in
+++ b/clutter/clutter.pc.in
@@ -4,18 +4,19 @@ libdir= libdir@
includedir= includedir@
apiversion= CLUTTER_API_VERSION@
-winsys= CLUTTER_WINSYS@
-soname_infix= CLUTTER_SONAME_INFIX@
-cogl_driver= COGL_DRIVER@
requires= CLUTTER_REQUIRES@
+backends= CLUTTER_BACKENDS@
# only kept for backward compatibility
+soname_infix= CLUTTER_SONAME_INFIX@
+winsys= CLUTTER_WINSYS@
cogl= COGL_DRIVER@
+cogl_driver= COGL_DRIVER@
backend= CLUTTER_WINSYS@
Name: Clutter
-Description: Clutter Core Library (${winsys}/${cogl_driver} backend)
+Description: Clutter Core Library
Version: @VERSION@
-Libs: -L${libdir} -lclutter-${soname_infix}-${apiversion}
+Libs: -L${libdir} -lclutter-${apiversion}
Cflags: -I${includedir}/clutter-${apiversion}
Requires: ${requires}
diff --git a/clutter/cogl/clutter-stage-cogl.c b/clutter/cogl/clutter-stage-cogl.c
index 57f1057..9f6ea6c 100644
--- a/clutter/cogl/clutter-stage-cogl.c
+++ b/clutter/cogl/clutter-stage-cogl.c
@@ -46,7 +46,7 @@
#include "clutter-util.h"
#ifdef CLUTTER_WINDOWING_X11
-/* needed for a small check in redraw() */
+/* FIXME: needed for a small check in redraw(), needs to be moved */
#include "x11/clutter-stage-x11.h"
#endif
@@ -353,24 +353,27 @@ clutter_stage_cogl_redraw (ClutterStageWindow *stage_window)
CLUTTER_TIMER_START (_clutter_uprof_context, painting_timer);
+ may_use_clipped_redraw = FALSE;
if (G_LIKELY (backend_cogl->can_blit_sub_buffer) &&
/* NB: a zero width redraw clip == full stage redraw */
stage_cogl->bounding_redraw_clip.width != 0 &&
/* some drivers struggle to get going and produce some junk
* frames when starting up... */
- G_LIKELY (stage_cogl->frame_count > 3)
+ G_LIKELY (stage_cogl->frame_count > 3))
+ {
#if defined(CLUTTER_WINDOWING_X11)
+ /* FIXME - move this to a StageWindow vfunc */
+
/* While resizing a window clipped redraws are disabled to avoid
* artefacts. See clutter-event-x11.c:event_translate for a
* detailed explanation */
- && G_LIKELY (CLUTTER_STAGE_X11 (stage_cogl)->clipped_redraws_cool_off == 0)
+ if (CLUTTER_IS_STAGE_X11 (stage_cogl) &&
+ (CLUTTER_STAGE_X11 (stage_cogl)->clipped_redraws_cool_off == 0))
+ {
+ may_use_clipped_redraw = TRUE;
+ }
#endif
- )
- {
- may_use_clipped_redraw = TRUE;
}
- else
- may_use_clipped_redraw = FALSE;
if (may_use_clipped_redraw &&
G_LIKELY (!(clutter_paint_debug_flags &
diff --git a/clutter/egl/clutter-backend-eglnative.c b/clutter/egl/clutter-backend-eglnative.c
index 2ee1f03..8568490 100644
--- a/clutter/egl/clutter-backend-eglnative.c
+++ b/clutter/egl/clutter-backend-eglnative.c
@@ -38,6 +38,7 @@
#include <errno.h>
#include "clutter-backend-eglnative.h"
+
/* This is a Cogl based backend */
#include "cogl/clutter-stage-cogl.h"
@@ -53,18 +54,18 @@
#ifdef COGL_HAS_EGL_SUPPORT
#include "clutter-egl.h"
#endif
-#ifdef COGL_HAS_EGL_PLATFORM_GDL_SUPPORT
+#ifdef CLUTTER_EGL_BACKEND_CEX100
#include "clutter-cex100.h"
#endif
-static gchar *clutter_vblank = NULL;
-
-/* FIXME: We should have CLUTTER_ define for this... */
-#ifdef COGL_HAS_EGL_PLATFORM_GDL_SUPPORT
+#ifdef CLUTTER_EGL_BACKEND_CEX100
static gdl_plane_id_t gdl_plane = GDL_PLANE_ID_UPP_C;
static guint gdl_n_buffers = CLUTTER_CEX100_TRIPLE_BUFFERING;
#endif
+static gboolean gdl_plane_set = FALSE;
+static gboolean gdl_n_buffers_set = FALSE;
+
G_DEFINE_TYPE (ClutterBackendEglNative, _clutter_backend_egl_native, CLUTTER_TYPE_BACKEND_COGL);
static ClutterDeviceManager *
@@ -91,6 +92,7 @@ clutter_backend_egl_native_init_events (ClutterBackend *backend)
#ifdef HAVE_TSLIB
_clutter_events_tslib_init (CLUTTER_BACKEND_EGL (backend));
#endif
+
#ifdef HAVE_EVDEV
_clutter_events_evdev_init (CLUTTER_BACKEND (backend));
#endif
@@ -157,9 +159,8 @@ clutter_backend_egl_native_create_context (ClutterBackend *backend,
swap_chain = cogl_swap_chain_new ();
-#ifdef COGL_HAS_EGL_PLATFORM_GDL_SUPPORT
- cogl_swap_chain_set_length (swap_chain, gdl_n_buffers);
-#endif
+ if (gdl_n_buffers_set)
+ cogl_swap_chain_set_length (swap_chain, gdl_n_buffers);
onscreen_template = cogl_onscreen_template_new (swap_chain);
cogl_object_unref (swap_chain);
@@ -176,9 +177,10 @@ clutter_backend_egl_native_create_context (ClutterBackend *backend,
backend->cogl_display = cogl_display_new (backend->cogl_renderer,
onscreen_template);
-#ifdef COGL_HAS_EGL_PLATFORM_GDL_SUPPORT
- cogl_gdl_display_set_plane (backend->cogl_display, gdl_plane);
-#endif
+#ifdef CLUTTER_EGL_BACKEND_CEX100
+ if (gdl_plane_set)
+ cogl_gdl_display_set_plane (backend->cogl_display, gdl_plane);
+#endif /* CLUTTER_EGL_BACKEND_CEX100 */
cogl_object_unref (backend->cogl_renderer);
cogl_object_unref (onscreen_template);
@@ -235,28 +237,41 @@ _clutter_backend_egl_native_init (ClutterBackendEglNative *backend_egl_native)
#endif
}
-GType
-_clutter_backend_impl_get_type (void)
-{
- return _clutter_backend_egl_native_get_type ();
-}
-
-/* FIXME we should have a CLUTTER_ define for this */
-#ifdef COGL_HAS_EGL_PLATFORM_GDL_SUPPORT
+/**
+ * clutter_cex100_set_plane:
+ * @plane: FIXME
+ *
+ * FIXME
+ *
+ * Since:
+ */
void
clutter_cex100_set_plane (gdl_plane_id_t plane)
{
+#ifdef CLUTTER_EGL_BACKEND_CEX100
g_return_if_fail (plane >= GDL_PLANE_ID_UPP_A && plane <= GDL_PLANE_ID_UPP_E);
gdl_plane = plane;
+ gdl_plane_set = TRUE;
+#endif
}
+/**
+ * clutter_cex100_set_plane:
+ * @mode: FIXME
+ *
+ * FIXME
+ *
+ * Since:
+ */
void
clutter_cex100_set_buffering_mode (ClutterCex100BufferingMode mode)
{
+#ifdef CLUTTER_EGL_BACKEND_CEX100
g_return_if_fail (mode == CLUTTER_CEX100_DOUBLE_BUFFERING ||
mode == CLUTTER_CEX100_TRIPLE_BUFFERING);
gdl_n_buffers = mode;
-}
+ gdl_n_buffers_set = TRUE;
#endif
+}
diff --git a/clutter/gdk/clutter-backend-gdk.c b/clutter/gdk/clutter-backend-gdk.c
index 564f1c7..39b2124 100644
--- a/clutter/gdk/clutter-backend-gdk.c
+++ b/clutter/gdk/clutter-backend-gdk.c
@@ -406,9 +406,15 @@ clutter_gdk_get_default_display (void)
{
ClutterBackend *backend = clutter_get_default_backend ();
- if (!backend || !CLUTTER_IS_BACKEND_GDK (backend))
+ if (backend == NULL)
{
- g_critical ("GDK backend has not been initialised");
+ g_critical ("The Clutter backend has not been initialised");
+ return NULL;
+ }
+
+ if (!CLUTTER_IS_BACKEND_GDK (backend))
+ {
+ g_critical ("The Clutter backend is not a GDK backend");
return NULL;
}
@@ -442,9 +448,3 @@ clutter_gdk_set_display (GdkDisplay *display)
_foreign_dpy = g_object_ref (display);
}
-
-GType
-_clutter_backend_impl_get_type (void)
-{
- return _clutter_backend_gdk_get_type ();
-}
diff --git a/clutter/gdk/clutter-gdk.h b/clutter/gdk/clutter-gdk.h
index 6aa825b..dc95bdb 100644
--- a/clutter/gdk/clutter-gdk.h
+++ b/clutter/gdk/clutter-gdk.h
@@ -41,14 +41,15 @@
G_BEGIN_DECLS
-void clutter_gdk_set_display (GdkDisplay *display);
-GdkWindow *clutter_gdk_get_stage_window (ClutterStage *stage);
-gboolean clutter_gdk_set_stage_foreign (ClutterStage *stage,
- GdkWindow *window);
+void clutter_gdk_set_display (GdkDisplay *display);
-GdkFilterReturn clutter_gdk_handle_event (GdkEvent *event);
+GdkWindow * clutter_gdk_get_stage_window (ClutterStage *stage);
+gboolean clutter_gdk_set_stage_foreign (ClutterStage *stage,
+ GdkWindow *window);
-ClutterStage *clutter_gdk_get_stage_from_window (GdkWindow *window);
+GdkFilterReturn clutter_gdk_handle_event (GdkEvent *event);
+
+ClutterStage * clutter_gdk_get_stage_from_window (GdkWindow *window);
G_END_DECLS
diff --git a/clutter/gdk/clutter-stage-gdk.c b/clutter/gdk/clutter-stage-gdk.c
index 2938a6a..a990f52 100644
--- a/clutter/gdk/clutter-stage-gdk.c
+++ b/clutter/gdk/clutter-stage-gdk.c
@@ -468,7 +468,7 @@ clutter_stage_window_iface_init (ClutterStageWindowIface *iface)
*
* Since: 0.4
*/
-GdkWindow*
+GdkWindow *
clutter_gdk_get_stage_window (ClutterStage *stage)
{
ClutterStageWindow *impl;
@@ -476,7 +476,11 @@ clutter_gdk_get_stage_window (ClutterStage *stage)
g_return_val_if_fail (CLUTTER_IS_STAGE (stage), None);
impl = _clutter_stage_get_window (stage);
- g_assert (CLUTTER_IS_STAGE_GDK (impl));
+ if (!CLUTTER_IS_STAGE_GDK (impl))
+ {
+ g_critical ("The Clutter backend is not a GDK backend");
+ return NULL;
+ }
return CLUTTER_STAGE_GDK (impl)->window;
}
@@ -552,6 +556,12 @@ clutter_gdk_set_stage_foreign (ClutterStage *stage,
g_return_val_if_fail (GDK_IS_WINDOW (window), FALSE);
impl = _clutter_stage_get_window (stage);
+ if (!CLUTTER_IS_STAGE_GDK (impl))
+ {
+ g_critical ("The Clutter backend is not a GDK backend");
+ return FALSE;
+ }
+
stage_gdk = CLUTTER_STAGE_GDK (impl);
if (g_object_get_data (G_OBJECT (window), "clutter-stage-window") != NULL)
diff --git a/clutter/osx/clutter-backend-osx.c b/clutter/osx/clutter-backend-osx.c
index 520f531..9590724 100644
--- a/clutter/osx/clutter-backend-osx.c
+++ b/clutter/osx/clutter-backend-osx.c
@@ -253,9 +253,3 @@ clutter_backend_osx_class_init (ClutterBackendOSXClass *klass)
backend_class->init_events = clutter_backend_osx_init_events;
backend_class->get_device_manager = clutter_backend_osx_get_device_manager;
}
-
-GType
-_clutter_backend_impl_get_type (void)
-{
- return clutter_backend_osx_get_type ();
-}
diff --git a/clutter/wayland/clutter-backend-wayland.c b/clutter/wayland/clutter-backend-wayland.c
index 56c23a2..3b90961 100644
--- a/clutter/wayland/clutter-backend-wayland.c
+++ b/clutter/wayland/clutter-backend-wayland.c
@@ -659,12 +659,6 @@ _clutter_backend_wayland_init (ClutterBackendWayland *backend_wayland)
backend_wayland->drm_fd = -1;
}
-GType
-_clutter_backend_impl_get_type (void)
-{
- return _clutter_backend_wayland_get_type ();
-}
-
EGLDisplay
clutter_wayland_get_egl_display (void)
{
diff --git a/clutter/win32/clutter-backend-win32.c b/clutter/win32/clutter-backend-win32.c
index 5ce3564..3587c18 100644
--- a/clutter/win32/clutter-backend-win32.c
+++ b/clutter/win32/clutter-backend-win32.c
@@ -376,12 +376,6 @@ clutter_backend_win32_init (ClutterBackendWin32 *backend_win32)
timeBeginPeriod (1);
}
-GType
-_clutter_backend_impl_get_type (void)
-{
- return clutter_backend_win32_get_type ();
-}
-
BOOL WINAPI
DllMain (HINSTANCE hinst, DWORD reason, LPVOID reserved)
{
diff --git a/clutter/win32/clutter-stage-win32.c b/clutter/win32/clutter-stage-win32.c
index a309d25..573b013 100644
--- a/clutter/win32/clutter-stage-win32.c
+++ b/clutter/win32/clutter-stage-win32.c
@@ -733,9 +733,13 @@ clutter_win32_set_stage_foreign (ClutterStage *stage,
g_return_val_if_fail (CLUTTER_IS_STAGE (stage), FALSE);
g_return_val_if_fail (hwnd != NULL, FALSE);
- actor = CLUTTER_ACTOR (stage);
-
impl = _clutter_stage_get_window (stage);
+ if (!CLUTTER_IS_STAGE_WIN32 (impl))
+ {
+ g_critical ("The Clutter backend is not a Windows backend");
+ return FALSE;
+ }
+
stage_win32 = CLUTTER_STAGE_WIN32 (impl);
if (!GetClientRect (hwnd, &client_rect))
@@ -758,6 +762,8 @@ clutter_win32_set_stage_foreign (ClutterStage *stage,
fwd.geom.width = client_rect.right - client_rect.left;
fwd.geom.height = client_rect.bottom - client_rect.top;
+ actor = CLUTTER_ACTOR (stage);
+
_clutter_actor_rerealize (actor,
set_foreign_window_callback,
&fwd);
diff --git a/clutter/x11/clutter-backend-x11.c b/clutter/x11/clutter-backend-x11.c
index 483205d..0aa3966 100644
--- a/clutter/x11/clutter-backend-x11.c
+++ b/clutter/x11/clutter-backend-x11.c
@@ -855,9 +855,15 @@ clutter_x11_get_default_display (void)
{
ClutterBackend *backend = clutter_get_default_backend ();
- if (!backend || !CLUTTER_IS_BACKEND_X11 (backend))
+ if (backend == NULL)
{
- g_critical ("X11 backend has not been initialised");
+ g_critical ("The Clutter backend has not been initialised");
+ return NULL;
+ }
+
+ if (!CLUTTER_IS_BACKEND_X11 (backend))
+ {
+ g_critical ("The Clutter backend is not a X11 backend");
return NULL;
}
@@ -986,9 +992,15 @@ clutter_x11_get_default_screen (void)
{
ClutterBackend *backend = clutter_get_default_backend ();
- if (!backend || !CLUTTER_IS_BACKEND_X11 (backend))
+ if (backend == NULL)
{
- g_critical ("X11 backend has not been initialised");
+ g_critical ("The Clutter backend has not been initialised");
+ return 0;
+ }
+
+ if (!CLUTTER_IS_BACKEND_X11 (backend))
+ {
+ g_critical ("The Clutter backend is not a X11 backend");
return 0;
}
@@ -1009,9 +1021,15 @@ clutter_x11_get_root_window (void)
{
ClutterBackend *backend = clutter_get_default_backend ();
- if (!backend || !CLUTTER_IS_BACKEND_X11 (backend))
+ if (backend == NULL)
{
- g_critical ("X11 backend has not been initialised");
+ g_critical ("The Clutter backend has not been initialised");
+ return None;
+ }
+
+ if (!CLUTTER_IS_BACKEND_X11 (backend))
+ {
+ g_critical ("The Clutter backend is not a X11 backend");
return None;
}
@@ -1037,9 +1055,15 @@ clutter_x11_add_filter (ClutterX11FilterFunc func,
g_return_if_fail (func != NULL);
- if (!backend || !CLUTTER_IS_BACKEND_X11 (backend))
+ if (backend == NULL)
{
- g_critical ("X11 backend has not been initialised");
+ g_critical ("The Clutter backend has not been initialised");
+ return;
+ }
+
+ if (!CLUTTER_IS_BACKEND_X11 (backend))
+ {
+ g_critical ("The Clutter backend is not a X11 backend");
return;
}
@@ -1075,9 +1099,15 @@ clutter_x11_remove_filter (ClutterX11FilterFunc func,
g_return_if_fail (func != NULL);
- if (!backend || !CLUTTER_IS_BACKEND_X11 (backend))
+ if (backend == NULL)
{
- g_critical ("X11 backend has not been initialised");
+ g_critical ("The Clutter backend has not been initialised");
+ return;
+ }
+
+ if (!CLUTTER_IS_BACKEND_X11 (backend))
+ {
+ g_critical ("The Clutter backend is not a X11 backend");
return;
}
@@ -1143,9 +1173,15 @@ clutter_x11_has_xinput (void)
#if defined(HAVE_XINPUT) || defined(HAVE_XINPUT_2)
ClutterBackend *backend = clutter_get_default_backend ();
- if (!backend || !CLUTTER_IS_BACKEND_X11 (backend))
+ if (backend == NULL)
{
- g_critical ("X11 backend has not been initialised");
+ g_critical ("The Clutter backend has not been initialised");
+ return FALSE;
+ }
+
+ if (!CLUTTER_IS_BACKEND_X11 (backend))
+ {
+ g_critical ("The Clutter backend is not a X11 backend.");
return FALSE;
}
@@ -1181,6 +1217,8 @@ clutter_x11_has_composite_extension (void)
}
dpy = clutter_x11_get_default_display();
+ if (dpy == NULL)
+ return FALSE;
if (XCompositeQueryExtension (dpy, &event, &error))
{
@@ -1272,8 +1310,16 @@ XVisualInfo *
clutter_x11_get_visual_info (void)
{
ClutterBackendX11 *backend_x11;
+ ClutterBackend *backend;
- backend_x11 = CLUTTER_BACKEND_X11 (clutter_get_default_backend ());
+ backend = clutter_get_default_backend ();
+ if (!CLUTTER_IS_BACKEND_X11 (backend))
+ {
+ g_critical ("The Clutter backend is not a X11 backend.");
+ return NULL;
+ }
+
+ backend_x11 = CLUTTER_BACKEND_X11 (backend);
return _clutter_backend_x11_get_visual_info (backend_x11);
}
@@ -1328,9 +1374,3 @@ _clutter_x11_input_device_translate_screen_coord (ClutterInputDevice *device,
return TRUE;
}
-
-GType
-_clutter_backend_impl_get_type (void)
-{
- return _clutter_backend_x11_get_type ();
-}
diff --git a/clutter/x11/clutter-x11-texture-pixmap.c b/clutter/x11/clutter-x11-texture-pixmap.c
index 0b459fc..265b137 100644
--- a/clutter/x11/clutter-x11-texture-pixmap.c
+++ b/clutter/x11/clutter-x11-texture-pixmap.c
@@ -529,7 +529,6 @@ clutter_x11_texture_pixmap_class_init (ClutterX11TexturePixmapClass *klass)
GObjectClass *object_class = G_OBJECT_CLASS (klass);
ClutterActorClass *actor_class = CLUTTER_ACTOR_CLASS (klass);
GParamSpec *pspec;
- ClutterBackend *default_backend;
g_type_class_add_private (klass, sizeof (ClutterX11TexturePixmapPrivate));
@@ -714,15 +713,6 @@ clutter_x11_texture_pixmap_class_init (ClutterX11TexturePixmapClass *klass)
g_signal_override_class_handler ("queue-damage-redraw",
CLUTTER_X11_TYPE_TEXTURE_PIXMAP,
G_CALLBACK (clutter_x11_texture_pixmap_real_queue_damage_redraw));
-
- default_backend = clutter_get_default_backend ();
-
- if (!CLUTTER_IS_BACKEND_X11 (default_backend))
- {
- g_critical ("ClutterX11TexturePixmap instantiated with a "
- "non-X11 backend");
- return;
- }
}
static void
@@ -954,13 +944,17 @@ clutter_x11_texture_pixmap_set_window (ClutterX11TexturePixmap *texture,
{
ClutterX11TexturePixmapPrivate *priv;
XWindowAttributes attr;
- Display *dpy = clutter_x11_get_default_display ();
+ Display *dpy;
g_return_if_fail (CLUTTER_X11_IS_TEXTURE_PIXMAP (texture));
if (!clutter_x11_has_composite_extension ())
return;
+ dpy = clutter_x11_get_default_display ();
+ if (dpy == NULL)
+ return;
+
#if HAVE_XCOMPOSITE
priv = texture->priv;
@@ -1058,7 +1052,7 @@ clutter_x11_texture_pixmap_sync_window_internal (ClutterX11TexturePixmap *textur
priv->window_height = height;
priv->override_redirect = override_redirect;
- if (!clutter_x11_has_composite_extension())
+ if (!clutter_x11_has_composite_extension ())
{
/* FIXME: this should just be an error, this is unlikely to work worth anything */
clutter_x11_texture_pixmap_set_pixmap (texture, priv->window);
@@ -1148,12 +1142,15 @@ clutter_x11_texture_pixmap_sync_window (ClutterX11TexturePixmap *texture)
if (priv->destroyed)
return;
- if (priv->window)
+ if (priv->window != None)
{
- XWindowAttributes attr;
Display *dpy = clutter_x11_get_default_display ();
+ XWindowAttributes attr;
Status status;
+ if (dpy == NULL)
+ return;
+
clutter_x11_trap_x_errors ();
status = XGetWindowAttributes (dpy, priv->window, &attr);
diff --git a/configure.ac b/configure.ac
index d8064be..7ac1a5e 100644
--- a/configure.ac
+++ b/configure.ac
@@ -77,10 +77,18 @@ CLUTTER_LT_REV=lt_revision
CLUTTER_LT_AGE=lt_age
CLUTTER_LT_VERSION="$CLUTTER_LT_CURRENT:$CLUTTER_LT_REV:$CLUTTER_LT_AGE"
CLUTTER_LT_LDFLAGS="-version-info $CLUTTER_LT_VERSION"
+AC_SUBST([CLUTTER_LT_CURRENT], [lt_current])
+AC_SUBST([CLUTTER_LT_REVISION], [lt_revision])
+AC_SUBST([CLUTTER_LT_VERSION], [$CLUTTER_LT_VERSION])
AC_PROG_SED
AC_CANONICAL_HOST
+
+platform_win32=no
+platform_quartz=no
+platform_linux=no
+
AC_MSG_CHECKING([if building for some Win32 platform])
AS_CASE([$host],
[*-*-mingw*|*-*-cygwin*],
@@ -89,15 +97,19 @@ AS_CASE([$host],
platform_win32=yes
],
- [platform_win32=no]
+ []
)
AC_MSG_RESULT([$platform_win32])
+
AM_CONDITIONAL(OS_WIN32, [test "$platform_win32" = "yes"])
AC_CHECK_HEADER([OpenGL/gl.h], [platform_quartz=yes], [platform_quartz=no])
AM_CONDITIONAL(OS_QUARTZ, [test "$platform_quartz" = "yes"])
-AC_SUBST(CLUTTER_LT_VERSION)
+AC_CHECK_HEADER([GL/glx.h], [platform_glx=yes], [platform_glx=no])
+AC_CHECK_LIB([GL], [glXCreateContext], [platform_glx=yes], [platform_glx=no])
+AM_CONDITIONAL(OS_GLX, [test "$platform_glx" = "yes"])
+
AC_SUBST(CLUTTER_LT_LDFLAGS)
dnl ========================================================================
@@ -176,17 +188,10 @@ AS_IF([test "x$platform_win32" = "xyes"], [CLUTTER_FLAVOUR=win32],
FLAVOUR_LIBS=""
FLAVOUR_CFLAGS=""
-CLUTTER_WINSYS_BASE=
-CLUTTER_WINSYS_BASE_LIB=
-CLUTTER_WINSYS=
+CLUTTER_BACKENDS=""
experimental_backend=no
-AC_ARG_WITH([flavour],
- [AS_HELP_STRING([--with-flavour=@<:@glx/opengl-egl-xlib/wayland/eglx/eglnative/osx/win32/cex100@:>@],
- [Select the Clutter window system backend])],
- [CLUTTER_FLAVOUR=$with_flavour])
-
# base dependencies for core
CLUTTER_BASE_PC_FILES="cogl-1.0 >= $COGL_REQ_VERSION cairo-gobject >= $CAIRO_REQ_VERSION atk >= $ATK_REQ_VERSION pangocairo >= $PANGO_REQ_VERSION cogl-pango-1.0 json-glib-1.0 >= $JSON_GLIB_REQ_VERSION"
@@ -195,255 +200,236 @@ BACKEND_PC_FILES=""
dnl === Clutter windowing system backend ======================================
-AS_CASE([$CLUTTER_FLAVOUR],
+AC_ARG_ENABLE([x11],
+ [AS_HELP_STRING([--enable-x11=@<:@yes/no@:>@], [Enable the X11 backend (default=no)])],
+ [],
+ [enable_x11=maybe])
+AC_ARG_ENABLE([win32],
+ [AS_HELP_STRING([--enable-win32=@<:@yes/no@:>@], [Enable the Windows backend (default=no)])],
+ [],
+ [enable_win32=maybe])
+AC_ARG_ENABLE([osx],
+ [AS_HELP_STRING([--enable-osx=@<:@yes/no@:>@], [Enable the OS X backend (default=no)])],
+ [],
+ [enable_osx=maybe])
+AC_ARG_ENABLE([gdk],
+ [AS_HELP_STRING([--enable-gdk=@<:@yes/no@:>@], [Enable the GDK backend (default=no)])],
+ [],
+ [enable_gdk=no])
+AC_ARG_ENABLE([wayland],
+ [AS_HELP_STRING([--enable-wayland=@<:@yes/no@:>@], [Enable the Wayland client backend (default=no)])],
+ [],
+ [enable_wayland=no])
+AC_ARG_ENABLE([egl],
+ [AS_HELP_STRING([--enable-egl=@<:@yes/no@:>@], [Enable the EGL framebuffer backend (default=no)])]
+ [],
+ [enable_egl=no])
- [glx],
- [
- CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_X11"
-
- SUPPORT_X11=1
- SUPPORT_XLIB=1
- SUPPORT_GLX=1
-
- CLUTTER_WINSYS=x11
- CLUTTER_WINSYS_BASE=cogl
- CLUTTER_SONAME_INFIX=glx
-
- # Mesa 7.3 added a GL pkg-config file, finally
- PKG_CHECK_EXISTS([gl],
- [BACKEND_PC_FILES="$BACKEND_PC_FILES gl"],
- # if a pkg-config file isn't found just add -lGL
- # and hope for the best.
- [FLAVOUR_LIBS="$FLAVOUR_LIBS -lGL"])
-
- # We might fall back to DRM for sync-to-vblank on GLX
- PKG_CHECK_EXISTS([libdrm],
- [
- AC_DEFINE([HAVE_DRM], [1], [Have libdrm support])
- BACKEND_PC_FILES="$BACKEND_PC_FILES libdrm"
- ],
- [])
- ],
+dnl Define default values
+AS_IF([test "x$platform_glx" = "xyes"], [enable_x11=yes])
+AS_IF([test "x$platform_win32" = "xyes"], [enable_win32=yes])
+AS_IF([test "x$platform_quartz" = "xyes"], [enable_osx=yes])
- [gdk],
- [
- CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_GDK"
+dnl Per-backend rules
+AS_IF([test "x$enable_x11" = "xyes"],
+ [
+ CLUTTER_BACKENDS="$CLUTTER_BACKENDS x11"
- # We don't claim to support X11 (even though that's the preferred
- # GDK backend), to avoid building all the ClutterX11 stuff
- SUPPORT_GDK=1
+ SUPPORT_X11=1
+ SUPPORT_GLX=1
+ SUPPORT_COGL=1
- CLUTTER_WINSYS=gdk
- CLUTTER_WINSYS_BASE=cogl
- CLUTTER_SONAME_INFIX=gdk
+ # Mesa 7.3 added a GL pkg-config file, finally, but if a pkg-config
+ # file isn't found just add -lGL and hope for the best.
+ PKG_CHECK_EXISTS([gl],
+ [BACKEND_PC_FILES="$BACKEND_PC_FILES gl"],
+ [FLAVOUR_LIBS="$FLAVOUR_LIBS -lGL"])
- BACKEND_PC_FILES="$BACKEND_PC_FILES gdk-3.0"
- PKG_CHECK_EXISTS([gl], [BACKEND_PC_FILES="$BACKEND_PC_FILES gl"], [])
- ],
+ # if Mesa has support for egl, we can use it as well
+ PKG_CHECK_EXISTS([egl],
+ [
+ BACKEND_PC_FILES="$BACKEND_PC_FILES egl"
+ SUPPORT_EGL=1
+ ],
+ [])
- [opengl-egl-xlib],
- [
- CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_X11"
- CLUTTER_EGL_BACKEND="generic"
-
- SUPPORT_X11=1
- SUPPORT_XLIB=1
- SUPPORT_EGL=1
- SUPPORT_EGL_PLATFORM_POWERVR_X11=1
-
- CLUTTER_WINSYS=x11
- CLUTTER_WINSYS_BASE=cogl
- # I think this winsys can be API and ABI compatible with the
- # glx flavour so we can also be cheeky and use the same soname
- CLUTTER_SONAME_INFIX=glx
-
- PKG_CHECK_EXISTS([gl], [BACKEND_PC_FILES="$BACKEND_PC_FILES gl"], [])
- PKG_CHECK_EXISTS([egl], [BACKEND_PC_FILES="$BACKEND_PC_FILES egl"], [])
- ],
+ # We might fall back to DRM for sync-to-vblank on GLX
+ PKG_CHECK_EXISTS([libdrm],
+ [
+ AC_DEFINE([HAVE_DRM], [1], [Have libdrm support])
+ BACKEND_PC_FILES="$BACKEND_PC_FILES libdrm"
+ ],
+ [])
- [wayland],
- [
- experimental_backend="yes"
- CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_WAYLAND"
+ # we use fontconfig API and pango-fc when the fontconfig
+ # configuration changes
+ PKG_CHECK_EXISTS([pangoft2],
+ [
+ AC_DEFINE([HAVE_PANGO_FT2], [1], [Supports PangoFt2])
+ BACKEND_PC_FILES="$BACKEND_PC_FILES pangoft2"
+ ],
+ [])
- SUPPORT_WAYLAND=1
+ AC_DEFINE([HAVE_CLUTTER_GLX], [1], [Have the GLX backend])
+ ])
- CLUTTER_WINSYS=wayland
- CLUTTER_SONAME_INFIX=wayland
+AS_IF([test "x$enable_gdk" = "xyes"],
+ [
+ CLUTTER_BACKENDS="$CLUTTER_BACKENDS gdk"
- PKG_CHECK_EXISTS([gl], [BACKEND_PC_FILES="$BACKEND_PC_FILES gl"], [])
- PKG_CHECK_EXISTS([egl], [BACKEND_PC_FILES="$BACKEND_PC_FILES egl"], [])
- PKG_CHECK_EXISTS([wayland-client xkbcommon],
- [BACKEND_PC_FILES="$BACKEND_PC_FILES wayland-client xkbcommon"], [])
- ],
+ SUPPORT_GDK=1
+ SUPPORT_COGL=1
- [eglx],
- [
- CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_X11"
- CLUTTER_EGL_BACKEND="generic"
+ BACKEND_PC_FILES="$BACKEND_PC_FILES gdk-3.0"
+ PKG_CHECK_EXISTS([gl], [BACKEND_PC_FILES="$BACKEND_PC_FILES gl"], [])
+ ])
- SUPPORT_X11=1
- SUPPORT_XLIB=1
- SUPPORT_EGL=1
- SUPPORT_EGL_PLATFORM_POWERVR_X11=1
+AS_IF([test "x$enable_wayland" = "xyes"],
+ [
+ CLUTTER_BACKENDS="$CLUTTER_BACKENDS wayland"
- CLUTTER_WINSYS=x11
- CLUTTER_WINSYS_BASE=cogl
- CLUTTER_SONAME_INFIX=eglx
- ],
+ experimental_backend="yes"
- [eglnative],
- [
- CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_EGL"
- CLUTTER_EGL_BACKEND="generic"
-
- SUPPORT_EGL=1
- SUPPORT_EGL_PLATFORM_POWERVR_NULL=1
-
- PKG_CHECK_MODULES(TSLIB, [tslib-1.0], [have_tslib=yes], [have_tslib=no])
- AS_IF([test "x$have_tslib" = "xyes"],
- [AC_DEFINE([HAVE_TSLIB], [1], [Have tslib for touchscreen handling])]
- )
-
- # evdev
- PKG_CHECK_MODULES(EVDEV, [gudev-1.0 xkbcommon],
- [have_evdev=yes], [have_evdev=no])
- AS_IF([test "x$have_evdev" = "xyes"],
- [AC_DEFINE([HAVE_EVDEV], 1,
- [Have evdev support for input handling])]
- )
-
- # Make sure we don't enable tslib and evdev at the same time, we
- # don't support multiple event backends yet.
- AS_IF([test "x$have_tslib" = "xyes" -a "x$have_evdev" = "xyes"],
- [AC_MSG_ERROR([Cannot enable both tslib and evdev events])])
-
- FLAVOUR_LIBS="$FLAVOUR_LIBS $TSLIB_LIBS $EVDEV_LIBS"
- FLAVOUR_CFLAGS="$FLAVOUR_CFLAGS $TSLIB_CFLAGS $EVDEV_CFLAGS"
-
- CLUTTER_WINSYS=cogl
- CLUTTER_SONAME_INFIX=eglnative
- ],
+ SUPPORT_WAYLAND=1
- [cex100],
- [
- CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_EGL"
- CLUTTER_EGL_BACKEND="cex100"
-
- SUPPORT_EGL=1
- SUPPORT_EGL_PLATFORM_GDL=1
-
- # The cex100 is a small specialization of the EGL backend
- CLUTTER_WINSYS=cogl
- CLUTTER_SONAME_INFIX=cex100
-
- found_gdl=no
- AC_CHECK_HEADERS([libgdl.h], [found_gdl=yes])
- AS_IF([test "x$found_gdl" = "xno"],
- [AC_CHECK_HEADERS([CE4100/libgdl.h],
- [
- FLAVOUR_CFLAGS="-I/usr/include/CE4100"
- found_gdl=yes
- CLUTTER_CEX100_LIBGDL_PREFIX=CE4100/
- ])
- ])
- AC_SUBST(CLUTTER_CEX100_LIBGDL_PREFIX)
+ PKG_CHECK_EXISTS([gl], [BACKEND_PC_FILES="$BACKEND_PC_FILES gl"], [])
+ PKG_CHECK_EXISTS([egl], [BACKEND_PC_FILES="$BACKEND_PC_FILES egl"], [])
+ PKG_CHECK_EXISTS([wayland-client xkbcommon],
+ [BACKEND_PC_FILES="$BACKEND_PC_FILES wayland-client xkbcommon"],
+ [])
- AS_IF([test x"$found_gdl" = "xno"], [AC_MSG_ERROR([libgdl.h not found])])
+ AC_DEFINE([HAVE_CLUTTER_WAYLAND], [1], [Have the Wayland backend])
+ ])
- # evdev
- PKG_CHECK_MODULES(EVDEV, [gudev-1.0 xkbcommon],
- [have_evdev=yes], [have_evdev=no])
- AS_IF([test "x$have_evdev" = "xyes"],
- [AC_DEFINE([HAVE_EVDEV], 1,
- [Have evdev support for input handling])]
- )
+AS_IF([test "x$enable_egl" = "xyes"],
+ [
+ CLUTTER_BACKENDS="$CLUTTER_BACKENDS egl"
- FLAVOUR_CFLAGS="$FLAVOUR_CFLAGS $EVDEV_CFLAGS"
- FLAVOUR_LIBS="$FLAVOUR_LIBS -lgdl $EVDEV_LIBS"
- ],
+ SUPPORT_EGL=1
+ SUPPORT_COGL=1
- [osx],
- [
- CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_OSX"
+ AC_ARG_WITH([tslib],
+ [AS_HELP_STRING([--with-tslib=@<:@yes/no@:>@], [Use TSLib for events])],
+ [],
+ [with_tslib=yes])
- AC_DEFINE([HAVE_CLUTTER_OSX], [1], [Have the OSX backend])
+ AC_ARG_WITH([evdev],
+ [AS_HELP_STRING([--with-evdev=@<:@yes/no@:>@], [Use evdev for events])],
+ [],
+ [with_evdev=yes])
- FLAVOUR_LIBS="$FLAVOUR_LIBS -framework Cocoa -framework OpenGL"
+ AC_ARG_WITH([gdl],
+ [AS_HELP_STRING([--with-gdl=@<:@yes/no@:>@], [Use libgdl for CE3100/CE4100 support])],
+ [],
+ [with_gdl=no])
- CLUTTER_WINSYS=osx
- CLUTTER_SONAME_INFIX=osx
- ],
+ AS_IF([test "x$with_tslib" = "xyes"],
+ [
+ PKG_CHECK_MODULES(TSLIB, [tslib-1.0], [have_tslib=yes], [have_tslib=no])
+ AS_IF([test "x$have_tslib" = "xyes"],
+ [
+ AC_DEFINE([HAVE_TSLIB], [1], [Have tslib for touchscreen handling])
+ ])
+ ])
- [win32],
- [
- CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_WIN32"
- AC_DEFINE([HAVE_CLUTTER_WIN32], [1], [Have the Win32 backend])
+ AS_IF([test "x$with_evdev" = "xyes"],
+ [
+ PKG_CHECK_MODULES(EVDEV, [gudev-1.0 xkbcommon], [have_evdev=yes], [have_evdev=no])
+ AS_IF([test "x$have_evdev" = "xyes"],
+ [
+ AC_DEFINE([HAVE_EVDEV], [1], [Have evdev support for input handling])
+ ])
+ ])
- FLAVOUR_LIBS="$FLAVOUR_LIBS -lopengl32 -lgdi32 -lwinmm"
- FLAVOUR_CFLAGS="$FLAVOUR_CFLAGS -D_WIN32_WINNT=0x0500"
+ AS_IF([test "x$with_gdl" = "xyes"],
+ [
+ have_gdl=no
- AC_CHECK_TOOL(WINDRES, windres, no)
- if test "$WINDRES" = no; then
- AC_MSG_ERROR([*** windres is required])
- fi
+ AC_CHECK_HEADERS([libgdl.h], [have_gdl=yes])
- CLUTTER_WINSYS=win32
- CLUTTER_SONAME_INFIX=win32
- ],
+ AS_IF([test "x$have_gdl" = "xno"],
+ [
+ AC_CHECK_HEADERS([CE4100/libgdl.h],
+ [
+ FLAVOUR_CFLAGS="-I/usr/include/CE4100"
+ have_gdl=yes
+ CLUTTER_CEX100_LIBGDL_PREFIX=CE4100/
+ ])
+ ])
- [AC_MSG_ERROR([Invalid backend for Clutter])]
-)
+ AC_SUBST(CLUTTER_CEX100_LIBGDL_PREFIX)
-AS_IF([test "x$SUPPORT_X11" = "x1"],
- [
- # we use fontconfig API and pango-fc when the fontconfig
- # configuration changes
- PKG_CHECK_EXISTS([pangoft2],
- [
- AC_DEFINE([HAVE_PANGO_FT2], [1], [Supports PangoFt2])
- BACKEND_PC_FILES="$BACKEND_PC_FILES pangoft2"
- ],
- [])
+ AS_IF([test "x$have_gdl" = "xno"], [AC_MSG_ERROR([libgdl.h not found])])
+
+ FLAVOUR_LIBS="$FLAVOUR_LIBS -lgdl"
+
+ SUPPORT_EGL_PLATFORM_GDL=1
+
+ AC_DEFINE([CLUTTER_EGL_BACKEND_CEX100], [1], [Use CEX100 EGL backend])
+ ])
+
+ # Make sure we don't enable tslib and evdev at the same time, we
+ # don't support multiple event backends yet.
+ AS_IF([test "x$have_tslib" = "xyes" -a "x$have_evdev" = "xyes"],
+ [
+ AC_MSG_ERROR([Cannot enable both tslib and evdev events])
+ ])
+
+ FLAVOUR_LIBS="$FLAVOUR_LIBS $TSLIB_LIBS $EVDEV_LIBS"
+ FLAVOUR_CFLAGS="$FLAVOUR_CFLAGS $TSLIB_CFLAGS $EVDEV_CFLAGS"
+
+ AC_DEFINE([CLUTTER_EGL_BACKEND_GENERIC], [1], [Use Generic EGL backend])
+
+ AC_DEFINE([HAVE_CLUTTER_EGL], [1], [Have the EGL backend])
])
-AS_IF([test "x$SUPPORT_GLX" = "x1"],
+AS_IF([test "x$enable_osx" = "xyes"],
[
- AC_DEFINE([HAVE_CLUTTER_GLX], [1], [Have the GLX backend])
+ CLUTTER_BACKENDS="$CLUTTER_BACKENDS osx"
+
+ AC_DEFINE([HAVE_CLUTTER_OSX], [1], [Have the OSX backend])
+
+ FLAVOUR_LIBS="$FLAVOUR_LIBS -framework Cocoa -framework OpenGL"
+
+ SUPPORT_OSX=1
])
-AS_IF([test "x$SUPPORT_WAYLAND" = "x1"],
+AS_IF([test "x$enable_win32" = "xyes"],
[
- AC_DEFINE([HAVE_CLUTTER_WAYLAND], [1], [Have the Wayland backend])
+ CLUTTER_BACKENDS="$CLUTTER_BACKENDS win32"
+
+ AC_DEFINE([HAVE_CLUTTER_WIN32], [1], [Have the Win32 backend])
+
+ FLAVOUR_LIBS="$FLAVOUR_LIBS -lopengl32 -lgdi32 -lwinmm"
+ FLAVOUR_CFLAGS="$FLAVOUR_CFLAGS -D_WIN32_WINNT=0x0500"
+
+ AC_CHECK_TOOL(WINDRES, [windres], [AC_MSG_ERROR([*** windres is required])])
+
+ SUPPORT_WIN32=1
])
-AS_IF([test "x$SUPPORT_EGL" = "x1"],
+AS_IF([test "x$CLUTTER_BACKENDS" = "x"],
[
- AC_DEFINE([HAVE_CLUTTER_EGL], [1], [Have the EGL backend])
+ AC_MSG_ERROR([No backend enabled. You need to enable at least one backend.])
])
-AS_IF([test "x$CLUTTER_EGL_BACKEND" = "xgeneric"],
- AC_DEFINE([CLUTTER_EGL_BACKEND_GENERIC], [1], [Use Generic EGL backend]))
-
-AS_IF([test "x$CLUTTER_EGL_BACKEND" = "xcex100"],
- AC_DEFINE([CLUTTER_EGL_BACKEND_CEX100], [1], [Use CEX100 EGL backend]))
-
-# winsys conditionals for use in automake files...
-AM_CONDITIONAL(SUPPORT_GLX, [test "x$SUPPORT_GLX" = "x1"])
-AM_CONDITIONAL(SUPPORT_X11, [test "x$SUPPORT_X11" = "x1"])
-AM_CONDITIONAL(SUPPORT_XLIB, [test "x$SUPPORT_XLIB" = "x1"])
-AM_CONDITIONAL(SUPPORT_GDK, [test "x$SUPPORT_GDK" = "x1"])
-AM_CONDITIONAL(SUPPORT_EGL, [test "x$SUPPORT_EGL" = "x1"])
-AM_CONDITIONAL(SUPPORT_OSX, [test "x$CLUTTER_WINSYS" = "xosx"])
-AM_CONDITIONAL(SUPPORT_WIN32, [test "x$CLUTTER_WINSYS" = "xwin32"])
-AM_CONDITIONAL(SUPPORT_CEX100, [test "x$SUPPORT_EGL_PLATFORM_GDL" = "x1"])
-AM_CONDITIONAL(SUPPORT_WAYLAND, [test "x$CLUTTER_WINSYS" = "xwayland"])
-AM_CONDITIONAL(SUPPORT_STUB, [test "x$CLUTTER_WINSYS" = "xwin32" -o \
- "x$CLUTTER_WINSYS" = "xosx" -o \
- "x$CLUTTER_WINSYS" = "xwayland"])
-
+# conditionals for use in automake files...
+AM_CONDITIONAL(SUPPORT_GLX, [test "x$SUPPORT_GLX" = "x1"])
+AM_CONDITIONAL(SUPPORT_X11, [test "x$SUPPORT_X11" = "x1"])
+AM_CONDITIONAL(SUPPORT_GDK, [test "x$SUPPORT_GDK" = "x1"])
+AM_CONDITIONAL(SUPPORT_EGL, [test "x$SUPPORT_EGL" = "x1"])
+AM_CONDITIONAL(SUPPORT_OSX, [test "x$SUPPORT_OSX" = "x1"])
+AM_CONDITIONAL(SUPPORT_WIN32, [test "x$SUPPORT_WIN32" = "x1"])
+AM_CONDITIONAL(SUPPORT_CEX100, [test "x$SUPPORT_EGL_PLATFORM_GDL" = "x1"])
+AM_CONDITIONAL(SUPPORT_WAYLAND, [test "x$SUPPORT_WAYLAND" = "x1"])
+AM_CONDITIONAL(SUPPORT_STUB, [test "x$SUPPORT_WIN32" = "x1" -o \
+ "x$SUPPORT_OSX" = "x1" -o \
+ "x$SUPPORT_WAYLAND" = "x1"])
+
+AM_CONDITIONAL(USE_COGL, [test "x$SUPPORT_COGL" = "x1"])
AM_CONDITIONAL(USE_TSLIB, [test "x$have_tslib" = "xyes"])
-AM_CONDITIONAL(SUPPORT_EVDEV, [test "x$have_evdev" = "xyes"])
+AM_CONDITIONAL(USE_EVDEV, [test "x$have_evdev" = "xyes"])
+AM_CONDITIONAL(USE_GLD, [test "x$have_gdl" = "xyes"])
dnl Instead of using AM_CFLAGS to ensure
dnl COGL_ENABLE_EXPERIMENTAL_2_0_API is defined while compiling clutter
@@ -452,12 +438,16 @@ dnl other tools such as glib-mkenums and gir-scanner don't end up
dnl using the define also.
AC_DEFINE([COGL_ENABLE_EXPERIMENTAL_2_0_API], [1], [Can use Cogl 2.0 API internally])
+dnl strip leading spaces
+CLUTTER_BACKENDS=${CLUTTER_BACKENDS#* }
+AC_SUBST(CLUTTER_BACKENDS)
+
dnl === Clutter configuration =================================================
CLUTTER_CONFIG_DEFINES=
# windowing systems
-AS_IF([test "x$SUPPORT_XLIB" = "x1"],
+AS_IF([test "x$SUPPORT_X11" = "x1"],
[CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
#define CLUTTER_WINDOWING_X11 1"])
AS_IF([test "x$SUPPORT_GDK" = "x1"],
@@ -469,13 +459,13 @@ AS_IF([test "x$SUPPORT_GLX" = "x1"],
AS_IF([test "x$SUPPORT_EGL" = "x1"],
[CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
#define CLUTTER_WINDOWING_EGL 1"])
-AS_IF([test "x$CLUTTER_WINSYS" = "xwayland"],
+AS_IF([test "x$SUPPORT_WAYLAND" = "x1"],
[CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
#define CLUTTER_WINDOWING_WAYLAND 1"])
-AS_IF([test "x$CLUTTER_WINSYS" = "xosx"],
+AS_IF([test "x$SUPPORT_OSX" = "x1"],
[CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
#define CLUTTER_WINDOWING_OSX 1"])
-AS_IF([test "x$CLUTTER_WINSYS" = "xwin32"],
+AS_IF([test "x$SUPPORT_WIN32" = "x1"],
[CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
#define CLUTTER_WINDOWING_WIN32 1"])
AS_IF([test "x$SUPPORT_EGL_PLATFORM_GDL" = "x1"],
@@ -484,22 +474,14 @@ AS_IF([test "x$SUPPORT_EGL_PLATFORM_GDL" = "x1"],
AC_SUBST([CLUTTER_CONFIG_DEFINES])
-dnl === Clutter substitutions =================================================
-# Eventually the idea of a winsys should be hidden from Clutter and moved
-# into Cogl, but for now we have CLUTTER_WINSYS...
-AC_SUBST([CLUTTER_WINSYS])
-# The same goes for the winsys-base...
-AC_SUBST([CLUTTER_WINSYS_BASE])
-AC_SUBST(CLUTTER_STAGE_TYPE)
-AC_SUBST(CLUTTER_SONAME_INFIX)
-
-CLUTTER_WINSYS_LIB=libclutter-$CLUTTER_SONAME_INFIX-$CLUTTER_API_VERSION.la
-AC_SUBST([CLUTTER_WINSYS_LIB])
-
dnl === Clutter substitutions kept for backwards compatibility ================
-AC_SUBST([CLUTTER_FLAVOUR])
-CLUTTER_COGL=undefined
-AC_SUBST([CLUTTER_COGL])
+AC_SUBST([CLUTTER_WINSYS], [deprecated])
+AC_SUBST([CLUTTER_WINSYS_BASE], [deprecated])
+AC_SUBST([CLUTTER_STAGE_TYPE], [deprecated])
+AC_SUBST([CLUTTER_SONAME_INFIX], [deprecated])
+AC_SUBST([CLUTTER_FLAVOUR], [deprecated])
+AC_SUBST([CLUTTER_COGL], [deprecated])
+AC_SUBST([COGL_DRIVER], [deprecated])
dnl === Image loading backend =================================================
IMAGE_PC_FILES=""
@@ -508,7 +490,7 @@ dnl === X11 checks, only for X11-based backends ===============================
X11_PC_FILES=""
x11_tests=no
-AS_IF([test "x$SUPPORT_XLIB" = "x1"],
+AS_IF([test "x$SUPPORT_X11" = "x1"],
[
# base X11 includes and libraries
AC_MSG_CHECKING([for X11])
@@ -689,7 +671,7 @@ AS_IF([test "x$SUPPORT_XLIB" = "x1"],
)
AM_CONDITIONAL([BUILD_XI2], [test "x$have_xinput2" = "xyes"])
-AM_CONDITIONAL(X11_TESTS, [test "x$x11_tests" = "xyes"])
+AM_CONDITIONAL([X11_TESTS], [test "x$x11_tests" = "xyes"])
dnl === Enable debug level ====================================================
@@ -1012,8 +994,6 @@ echo " â Global:"
echo " Prefix: ${prefix}"
echo " Libdir: ${libdir}"
echo " Sysconfdir: ${sysconfdir}"
-echo " Flavour: ${CLUTTER_WINSYS}"
-echo " Target library: ${CLUTTER_WINSYS_LIB}"
# Compiler/Debug related flags
echo ""
@@ -1038,21 +1018,29 @@ echo " Build conformance test suite: ${enable_conformance}"
# Clutter backend related flags
echo ""
-echo " â Clutter Backend:"
+echo " â Clutter Backends:"
if test "x$experimental_backend" = "xno"; then
-echo " Windowing system: ${CLUTTER_WINSYS}"
+echo " Windowing systems: ${CLUTTER_BACKENDS}"
else
-echo " Windowing system: ${CLUTTER_WINSYS} (WARNING: Experimental)"
+echo " Windowing systems: ${CLUTTER_BACKENDS} (WARNING: Experimental backends enabled)"
fi
-if test "x$SUPPORT_XLIB" = "x1"; then
+if test "x$SUPPORT_X11" = "x1"; then
+echo ""
echo " Enable XComposite: ${have_xcomposite}"
echo " Enable XInput: ${have_xinput}"
echo " Enable Xge: ${have_xge}"
echo " Enable XI2: ${have_xinput2}"
echo " Enable XKB: ${have_xkb}"
-echo " Enable X11 tests: ${x11_tests}"
+echo " Build X11-specific tests: ${x11_tests}"
+fi
+
+if test "x$SUPPORT_EGL" = "x1"; then
+echo ""
+echo " Enable TSLib: ${have_tslib}"
+echo " Enable evdev: ${have_evdev}"
+echo " Enable GDL: ${have_gdl}"
fi
echo ""
diff --git a/doc/cookbook/examples/Makefile.am b/doc/cookbook/examples/Makefile.am
index 2269443..553459b 100644
--- a/doc/cookbook/examples/Makefile.am
+++ b/doc/cookbook/examples/Makefile.am
@@ -57,7 +57,7 @@ INCLUDES = \
-I$(top_builddir)/clutter \
$(NULL)
-LDADD = $(top_builddir)/clutter/libclutter- CLUTTER_SONAME_INFIX@- CLUTTER_API_VERSION@.la
+LDADD = $(top_builddir)/clutter/libclutter- CLUTTER_API_VERSION@.la
AM_CFLAGS = $(CLUTTER_CFLAGS) $(MAINTAINER_CFLAGS)
diff --git a/doc/reference/cally/Makefile.am b/doc/reference/cally/Makefile.am
index 34c408b..797d463 100644
--- a/doc/reference/cally/Makefile.am
+++ b/doc/reference/cally/Makefile.am
@@ -79,7 +79,7 @@ expand_content_files= \
# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib)
INCLUDES=-I$(top_srcdir) -I$(top_srcdir)/clutter -I$(top_srcdir)/clutter/cogl -I$(top_builddir) -I$(top_builddir)/clutter -I$(top_builddir)/clutter/cogl $(CLUTTER_CFLAGS)
-GTKDOC_LIBS=$(top_builddir)/clutter/libclutter- CLUTTER_SONAME_INFIX@- CLUTTER_API_VERSION@.la $(CLUTTER_LIBS)
+GTKDOC_LIBS=$(top_builddir)/clutter/libclutter- CLUTTER_API_VERSION@.la $(CLUTTER_LIBS)
# This includes the standard gtk-doc make rules, copied by gtkdocize.
include $(top_srcdir)/gtk-doc.make
diff --git a/doc/reference/clutter/Makefile.am b/doc/reference/clutter/Makefile.am
index 7dc39ee..901ac59 100644
--- a/doc/reference/clutter/Makefile.am
+++ b/doc/reference/clutter/Makefile.am
@@ -162,7 +162,7 @@ expand_content_files= \
# e.g. GTKDOC_LIBS=$(top_builddir)/gtk/$(gtktargetlib)
INCLUDES=-I$(top_srcdir) -I$(top_srcdir)/clutter -I$(top_srcdir)/clutter/cogl -I$(top_builddir) -I$(top_builddir)/clutter -I$(top_builddir)/clutter/cogl $(CLUTTER_CFLAGS)
-GTKDOC_LIBS=$(top_builddir)/clutter/libclutter- CLUTTER_SONAME_INFIX@- CLUTTER_API_VERSION@.la $(CLUTTER_LIBS)
+GTKDOC_LIBS=$(top_builddir)/clutter/libclutter- CLUTTER_API_VERSION@.la $(CLUTTER_LIBS)
# This includes the standard gtk-doc make rules, copied by gtkdocize.
include $(top_srcdir)/gtk-doc.make
diff --git a/tests/accessibility/Makefile.am b/tests/accessibility/Makefile.am
index 85aa43a..7d8572e 100644
--- a/tests/accessibility/Makefile.am
+++ b/tests/accessibility/Makefile.am
@@ -1,7 +1,7 @@
include $(top_srcdir)/build/autotools/Makefile.am.silent
common_ldadd = \
- $(top_builddir)/clutter/libclutter- CLUTTER_SONAME_INFIX@- CLUTTER_API_VERSION@.la
+ $(top_builddir)/clutter/libclutter- CLUTTER_API_VERSION@.la
common_sources = \
cally-examples-util.c \
diff --git a/tests/conform/Makefile.am b/tests/conform/Makefile.am
index f017f2c..84b4c38 100644
--- a/tests/conform/Makefile.am
+++ b/tests/conform/Makefile.am
@@ -165,7 +165,7 @@ test_conformance_CPPFLAGS = \
test_conformance_CFLAGS = -g $(CLUTTER_CFLAGS) $(MAINTAINER_CFLAGS)
-test_conformance_LDADD = $(top_builddir)/clutter/libclutter- CLUTTER_SONAME_INFIX@- CLUTTER_API_VERSION@.la $(CLUTTER_LIBS)
+test_conformance_LDADD = $(top_builddir)/clutter/libclutter- CLUTTER_API_VERSION@.la $(CLUTTER_LIBS)
test_conformance_LDFLAGS = -export-dynamic
diff --git a/tests/interactive/Makefile.am b/tests/interactive/Makefile.am
index cf324ec..f384742 100644
--- a/tests/interactive/Makefile.am
+++ b/tests/interactive/Makefile.am
@@ -128,7 +128,7 @@ INCLUDES = \
-I$(top_builddir)/clutter \
-I$(top_builddir)/clutter/cogl
-common_ldadd = $(top_builddir)/clutter/libclutter- CLUTTER_SONAME_INFIX@- CLUTTER_API_VERSION@.la
+common_ldadd = $(top_builddir)/clutter/libclutter- CLUTTER_API_VERSION@.la
noinst_PROGRAMS = test-interactive
diff --git a/tests/micro-bench/Makefile.am b/tests/micro-bench/Makefile.am
index 4824bb2..8739da6 100644
--- a/tests/micro-bench/Makefile.am
+++ b/tests/micro-bench/Makefile.am
@@ -1,6 +1,6 @@
include $(top_srcdir)/build/autotools/Makefile.am.silent
-common_ldadd = $(top_builddir)/clutter/libclutter- CLUTTER_SONAME_INFIX@- CLUTTER_API_VERSION@.la
+common_ldadd = $(top_builddir)/clutter/libclutter- CLUTTER_API_VERSION@.la
noinst_PROGRAMS = \
test-text \
diff --git a/tests/performance/Makefile.am b/tests/performance/Makefile.am
index 337cf66..14a4415 100644
--- a/tests/performance/Makefile.am
+++ b/tests/performance/Makefile.am
@@ -14,7 +14,7 @@ INCLUDES = \
-I$(top_srcdir)/clutter \
-I$(top_builddir)/clutter
-common_ldadd = $(top_builddir)/clutter/libclutter- CLUTTER_SONAME_INFIX@- CLUTTER_API_VERSION@.la
+common_ldadd = $(top_builddir)/clutter/libclutter- CLUTTER_API_VERSION@.la
LDADD = $(common_ldadd) $(CLUTTER_LIBS) -lm
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]