diff --git a/.gitignore b/.gitignore index 68ff6d44d..04a2e6cf0 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ compile stamp-enum-types stamp-marshal /ChangeLog* +/clutter/clutter-config.h /clutter/clutter-enum-types.[ch] /clutter/clutter-marshal.[ch] /clutter/clutter-version.h diff --git a/clutter/Makefile.am b/clutter/Makefile.am index 42c964e78..e75ef7004 100644 --- a/clutter/Makefile.am +++ b/clutter/Makefile.am @@ -264,6 +264,10 @@ built_source_h = \ clutter-marshal.h \ $(NULL) +# config header +DISTCLEANFILES += clutter-config.h +EXTRA_DIST += clutter-config.h.in + # version header DISTCLEANFILES += clutter-version.h EXTRA_DIST += clutter-version.h.in @@ -612,6 +616,7 @@ DISTCLEANFILES += $(pc_files) clutter_include_HEADERS = $(source_h) $(top_srcdir)/clutter/clutter.h nodist_clutter_include_HEADERS = \ + $(top_builddir)/clutter/clutter-config.h \ $(top_builddir)/clutter/clutter-version.h \ $(built_source_h) diff --git a/clutter/clutter-config.h.in b/clutter/clutter-config.h.in new file mode 100644 index 000000000..0aeadd25c --- /dev/null +++ b/clutter/clutter-config.h.in @@ -0,0 +1,16 @@ +#if !defined(__CLUTTER_H_INSIDE__) && !defined(CLUTTER_COMPILATION) +#error "Only can be included directly." +#endif + +#ifndef __CLUTTER_CONFIG_H__ +#define __CLUTTER_CONFIG_H__ + +#include + +G_BEGIN_DECLS + +@CLUTTER_CONFIG_DEFINES@ + +G_END_DECLS + +#endif /* __CLUTTER_CONFIG_H__ */ diff --git a/clutter/clutter.h b/clutter/clutter.h index 8448a4490..3729cf8eb 100644 --- a/clutter/clutter.h +++ b/clutter/clutter.h @@ -30,6 +30,8 @@ #include "clutter-deprecated.h" +#include "clutter-config.h" + #include "clutter-action.h" #include "clutter-actor.h" #include "clutter-actor-meta.h" diff --git a/configure.ac b/configure.ac index 8abcfac7b..0f1db8d45 100644 --- a/configure.ac +++ b/configure.ac @@ -673,6 +673,35 @@ dnl using the define also. AC_DEFINE([COGL_ENABLE_EXPERIMENTAL_2_0_API], [1], [Can use Cogl 2.0 API internally]) +dnl === Clutter configuration ================================================= + +CLUTTER_CONFIG_DEFINES= + +# windowing systems +AS_IF([test "x$SUPPORT_XLIB" = "x1"], + [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES +#define CLUTTER_WINDOWING_X11 1"]) +AS_IF([test "x$SUPPORT_GLX" = "x1"], + [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES +#define CLUTTER_WINDOWING_GLX 1"]) +AS_IF([test "x$SUPPORT_EGL" = "x1"], + [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES +#define CLUTTER_WINDOWING_EGL 1"]) +AS_IF([test "x$SUPPORT_WAYLAND" = "x1"], + [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES +#define CLUTTER_WINDOWING_WAYLAND 1"]) +AS_IF([test "x$SUPPORT_OSX" = "x1"], + [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES +#define CLUTTER_WINDOWING_OSX 1"]) +AS_IF([test "x$SUPPORT_WIN32" = "x1"], + [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES +#define CLUTTER_WINDOWING_WIN32 1"]) +AS_IF([test "x$SUPPORT_CEX100" = "x1"], + [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES +#define CLUTTER_WINDOWING_CEX100 1"]) + +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... @@ -1121,6 +1150,7 @@ AC_CONFIG_FILES([ build/mingw/Makefile clutter/Makefile + clutter/clutter-config.h clutter/clutter-version.h clutter/clutter-$CLUTTER_API_VERSION.pc:clutter/clutter.pc.in