keysyms-update: Add deprecation guards to the deprecated header
[profile/ivi/clutter.git] / configure.ac
index 977fe4d..86b01f9 100644 (file)
@@ -9,8 +9,8 @@
 # - increase clutter_micro_version to the next odd number
 # - increase clutter_interface_version to the next odd number
 m4_define([clutter_major_version], [1])
-m4_define([clutter_minor_version], [9])
-m4_define([clutter_micro_version], [3])
+m4_define([clutter_minor_version], [11])
+m4_define([clutter_micro_version], [5])
 
 # • for stable releases: increase the interface age by 1 for each release;
 #   if the API changes, set to 0. interface_age and binary_age are used to
@@ -99,6 +99,11 @@ AS_CASE([$host],
           platform_win32=yes
         ],
 
+        [*-*-linux*],
+        [
+          platform_linux=yes
+        ],
+
         []
 )
 AC_MSG_RESULT([$platform_win32])
@@ -111,6 +116,7 @@ AM_CONDITIONAL(OS_QUARTZ, [test "$platform_quartz" = "yes"])
 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"])
+AM_CONDITIONAL(OS_LINUX, [test "$platform_linux" = "yes"])
 
 AC_SUBST(CLUTTER_LT_LDFLAGS)
 
@@ -129,18 +135,18 @@ LT_INIT([disable-static])
 AC_HEADER_STDC
 
 # required versions for dependencies
-m4_define([glib_req_version],           [2.31.0])
-m4_define([cogl_req_version],           [1.9.1])
+m4_define([glib_req_version],           [2.31.19])
+m4_define([cogl_req_version],           [1.9.6])
 m4_define([json_glib_req_version],      [0.12.0])
 m4_define([atk_req_version],            [2.1.5])
 m4_define([cairo_req_version],          [1.10])
-m4_define([pango_req_version],          [1.20])
+m4_define([pango_req_version],          [1.30])
 m4_define([gi_req_version],             [0.9.5])
 m4_define([uprof_req_version],          [0.3])
 m4_define([gtk_doc_req_version],        [1.15])
 m4_define([xfixes_req_version],         [3])
 m4_define([xcomposite_req_version],     [0.4])
-m4_define([gdk_req_version],            [3.0.0])
+m4_define([gdk_req_version],            [3.3.18])
 
 AC_SUBST([GLIB_REQ_VERSION],       [glib_req_version])
 AC_SUBST([COGL_REQ_VERSION],       [cogl_req_version])
@@ -201,9 +207,15 @@ experimental_input_backend=no
 # 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"
 
+# private base dependencies
+CLUTTER_BASE_PC_FILES_PRIVATE=""
+
 # backend specific pkg-config files
 BACKEND_PC_FILES=""
 
+# private backend specific dependencies
+BACKEND_PC_FILES_PRIVATE=""
+
 dnl === Clutter windowing system backend ======================================
 
 AC_ARG_ENABLE([x11-backend],
@@ -266,26 +278,13 @@ AS_IF([test "x$enable_x11" = "xyes"],
         SUPPORT_GLX=1
         SUPPORT_COGL=1
 
-        # 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"])
-
-        # 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"
-                         ],
-                         [])
-
-        # we use fontconfig API and pango-fc when the fontconfig
-        # configuration changes
+        # we use fontconfig API and pango-ft2 when the fontconfig
+        # configuration changes; we don't expose any API for this
+        # so we add pango-ft2 to the private Requires.
         PKG_CHECK_EXISTS([pangoft2],
                          [
                            AC_DEFINE([HAVE_PANGO_FT2], [1], [Supports PangoFt2])
-                           BACKEND_PC_FILES="$BACKEND_PC_FILES pangoft2"
+                           BACKEND_PC_FILES_PRIVATE="$BACKEND_PC_FILES_PRIVATE pangoft2"
                          ],
                          [])
 
@@ -301,7 +300,6 @@ AS_IF([test "x$enable_gdk" = "xyes"],
         SUPPORT_COGL=1
 
        BACKEND_PC_FILES="$BACKEND_PC_FILES gdk-3.0"
-       PKG_CHECK_EXISTS([gl], [BACKEND_PC_FILES="$BACKEND_PC_FILES gl"], [])
       ])
 
 AS_IF([test "x$enable_wayland" = "xyes"],
@@ -313,18 +311,22 @@ AS_IF([test "x$enable_wayland" = "xyes"],
 
         SUPPORT_WAYLAND=1
 
-        PKG_CHECK_EXISTS([wayland-client xkbcommon],
-                         [BACKEND_PC_FILES="$BACKEND_PC_FILES wayland-client xkbcommon"],
+        PKG_CHECK_EXISTS([wayland-client xkbcommon gdk-pixbuf-2.0],
+                         [
+                            BACKEND_PC_FILES="$BACKEND_PC_FILES wayland-client xkbcommon"
+                            BACKEND_PC_FILES_PRIVATE="$BACKEND_PC_FILES_PRIVATE gdk-pixbuf-2.0"
+                         ],
                          [])
 
-        AC_DEFINE([HAVE_CLUTTER_WAYLAND], [1], [Have the Wayland backend])
+        AC_DEFINE([HAVE_CLUTTER_WAYLAND], [1], [Have the Wayland client backend])
       ])
 
 dnl Note this is orthogonal to the client side support and you can
-dnl use the wayland compositor features with any of the clutter
+dnl use the Wayland compositor features with any of the clutter
 dnl backends with corresponding Cogl support.
 AC_ARG_ENABLE([wayland-compositor],
-              [AS_HELP_STRING([--enable-wayland-compositor], [Enable Wayland compositor features])],
+              [AS_HELP_STRING([--enable-wayland-compositor=@<:@yes/no@:>@],
+                              [Enable Wayland compositor features (default=no)])],
               [],
               [AS_IF([test "x$SUPPORT_EGL" = "x1"],
                      [enable_wayland_compositor=yes],
@@ -338,8 +340,9 @@ AS_IF([test "x$enable_wayland_compositor" = "xyes"],
         SUPPORT_WAYLAND_COMPOSITOR=1
        CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
 #define CLUTTER_HAS_WAYLAND_COMPOSITOR_SUPPORT 1"
-        AC_DEFINE([HAVE_CLUTTER_WAYLAND_COMPOSITOR], [1], [Have wayland compositor support])
+        AC_DEFINE([HAVE_CLUTTER_WAYLAND_COMPOSITOR], [1], [Have Wayland compositor support])
       ])
+
 AM_CONDITIONAL(SUPPORT_WAYLAND_COMPOSITOR, [test "x$SUPPORT_WAYLAND_COMPOSITOR" = "x1"])
 
 AS_IF([test "x$enable_wayland_compositor" != "xyes" -a "x$enable_wayland" != "xyes"],
@@ -357,7 +360,7 @@ AS_IF([test "x$enable_cex100" = "xyes"],
         experimental_backend="yes"
 
         SUPPORT_COGL=1
-        SUPPORT_EGL_PLATFORM_GDL=1
+        SUPPORT_CEX100=1
 
         have_gdl=no
         AC_CHECK_HEADERS([libgdl.h], [have_gdl=yes])
@@ -393,13 +396,6 @@ AS_IF([test "x$enable_egl" = "xyes"],
         SUPPORT_EGL=1
         SUPPORT_COGL=1
 
-        # if Mesa has support for egl, we can use it as well
-        PKG_CHECK_EXISTS([egl],
-                         [
-                           BACKEND_PC_FILES="$BACKEND_PC_FILES egl"
-                         ],
-                         [])
-
         FLAVOUR_LIBS="$FLAVOUR_LIBS $TSLIB_LIBS $EVDEV_LIBS"
         FLAVOUR_CFLAGS="$FLAVOUR_CFLAGS $TSLIB_CFLAGS $EVDEV_CFLAGS"
 
@@ -440,6 +436,11 @@ AS_IF([test "x$CLUTTER_BACKENDS" = "x"],
         AC_MSG_ERROR([No backend enabled. You need to enable at least one backend.])
       ])
 
+AS_IF([test "x$platform_linux" = "xyes"],
+      [
+        AC_DEFINE([OS_LINUX], [1], [Define to 1 if building for Linux])
+      ])
+
 # additional input backends
 
 AC_ARG_ENABLE([tslib-input],
@@ -447,7 +448,7 @@ AC_ARG_ENABLE([tslib-input],
               [enable_tslib=$enableval],
               [enable_tslib=no])
 AC_ARG_ENABLE([evdev-input],
-              [AS_HELP_STRING([--with-evdev=@<:@yes/no@:>@], [Enable evdev for input events (default=no)])],
+              [AS_HELP_STRING([--enable-evdev-input=@<:@yes/no@:>@], [Enable evdev for input events (default=no)])],
               [enable_evdev=$enableval],
               [enable_evdev=no])
 
@@ -483,16 +484,16 @@ 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_CEX100,  [test "x$SUPPORT_CEX100" = "x1"])
 AM_CONDITIONAL(SUPPORT_WAYLAND, [test "x$SUPPORT_WAYLAND" = "x1"])
-AM_CONDITIONAL(SUPPORT_STUB,    [test "x$SUPPORT_WIN32" = "x1" -o \
-                                      "x$SUPPORT_OSX" = "x1"])
 
 AM_CONDITIONAL(USE_COGL,  [test "x$SUPPORT_COGL" = "x1"])
 AM_CONDITIONAL(USE_TSLIB, [test "x$have_tslib" = "xyes"])
 AM_CONDITIONAL(USE_EVDEV, [test "x$have_evdev" = "xyes"])
 AM_CONDITIONAL(USE_GLD,   [test "x$have_gdl" = "xyes"])
 
+AM_CONDITIONAL(NEED_XKB_UTILS, [test "x$have_evdev" = "xyes" -o "x$SUPPORT_WAYLAND" = "x1"])
+
 dnl Instead of using AM_CFLAGS to ensure
 dnl COGL_ENABLE_EXPERIMENTAL_2_0_API is defined while compiling clutter
 dnl and cogl code we use a define in config.h instead. This helps ensure
@@ -537,7 +538,7 @@ AS_IF([test "x$SUPPORT_WIN32" = "x1"],
       [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
 #define CLUTTER_WINDOWING_WIN32 \"win32\"
 #define CLUTTER_INPUT_WIN32 \"win32\""])
-AS_IF([test "x$SUPPORT_EGL_PLATFORM_GDL" = "x1"],
+AS_IF([test "x$SUPPORT_CEX100" = "x1"],
       [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
 #define CLUTTER_WINDOWING_CEX100 \"cex100\""])
 AS_IF([test "x$SUPPORT_EVDEV" = "x1"],
@@ -565,9 +566,6 @@ AC_SUBST([CLUTTER_FLAVOUR],      [deprecated])
 AC_SUBST([CLUTTER_COGL],         [deprecated])
 AC_SUBST([COGL_DRIVER],          [deprecated])
 
-dnl === Image loading backend =================================================
-IMAGE_PC_FILES=""
-
 dnl === X11 checks, only for X11-based backends ===============================
 X11_PC_FILES=""
 X11_EXTS=""
@@ -723,9 +721,27 @@ AS_IF([test "x$SUPPORT_X11" = "x1"],
                                                [Define to 1 if XInput is available])
                                    ])
 
+                  clutter_save_LIBS="$LIBS"
+                  LIBS="$LIBS -lXi"
+
+                  AC_CHECK_FUNC([XIAllowTouchEvents],
+                                [
+                                  AC_CHECK_MEMBER([XIScrollClassInfo.number],
+                                                  [
+                                                    have_xinput_2_2=yes
+                                                    AC_DEFINE([HAVE_XINPUT_2_2], [1], [Define to 1 if XInput 2.2 is available])
+                                                  ],
+                                                  [have_xinput_2_2=no],
+                                                  [[#include <X11/extensions/XInput2.h>]])])
+
+                  LIBS="$clutter_save_LIBS"
+
                   X11_LIBS="$X11_LIBS $XINPUT_LIBS"
                   X11_PC_FILES="$X11_PC_FILES xi"
-                  X11_EXTS="$X11_EXTS xi"
+
+                  AS_IF([test "x$have_xinput_2_2" = "xyes"],
+                        [X11_EXTS="$X11_EXTS xi2.2"],
+                        [X11_EXTS="$X11_EXTS xi2.0"])
                 ],
 
                 [no],
@@ -768,6 +784,33 @@ X11_EXTS=${X11_EXTS#* }
 
 AC_CACHE_SAVE
 
+dnl === Enable GDK-Pixbuf in tests ============================================
+
+m4_define([pixbuf_default], [yes])
+AC_ARG_ENABLE([gdk-pixbuf],
+              [AS_HELP_STRING([--enable-gdk-pixbuf=@<:@no/yes@:>@],
+                              [Enable tests using GDK-Pixbuf @<:@default=]pixbuf_default[@:>@])],
+              [enable_pixbuf=$enable_val],
+              [enable_pixbuf=pixbuf_default])
+
+AS_CASE([$enable_pixbuf],
+
+        [yes],
+        [
+          PKG_CHECK_MODULES([GDK_PIXBUF], [gdk-pixbuf-2.0])
+          AC_SUBST(GDK_PIXBUF_CFLAGS)
+          AC_SUBST(GDK_PIXBUF_LIBS)
+          pixbuf_tests=yes
+        ],
+
+        [no],
+        [
+          pixbuf_tests=no
+        ]
+)
+
+AM_CONDITIONAL([PIXBUF_TESTS], [test "x$pixbuf_tests" = "xyes"])
+
 dnl === Enable debug level ====================================================
 
 m4_define([debug_default], [m4_if(m4_eval(clutter_minor_version % 2), [1], [yes], [minimum])])
@@ -819,7 +862,7 @@ AS_CASE([$enable_deprecated],
 
         [yes],
         [
-          CLUTTER_DEPRECATED_CFLAGS="-DGLIB_DISABLE_DEPRECATION_WARNINGS -DCLUTTER_DISABLE_DEPRECATION_WARNINGS"
+          CLUTTER_DEPRECATED_CFLAGS="-DGLIB_DISABLE_DEPRECATION_WARNINGS"
         ],
 
         [AC_MSG_ERROR([Unknown argument for --enable-deprecated])]
@@ -828,16 +871,6 @@ AS_CASE([$enable_deprecated],
 AC_SUBST([CLUTTER_DEPRECATED_CFLAGS])
 
 
-dnl === Conformance test suite ================================================
-
-AC_ARG_ENABLE([conformance],
-              [AS_HELP_STRING([--enable-conformance=@<:@no/yes@:>@],
-                              [Build conformance test suite @<:@default=yes@:>@])],
-              [],
-              [enable_conformance=yes])
-
-AM_CONDITIONAL([BUILD_TESTS], [test "x$enable_conformance" = "xyes"])
-
 dnl === Profiling =============================================================
 
 m4_define([profile_default], [no])
@@ -920,9 +953,11 @@ AC_ARG_ENABLE([maintainer-flags],
 MAINTAINER_COMPILER_FLAGS="$MAINTAINER_COMPILER_FLAGS
                            -Wall -Wcast-align -Wuninitialized
                            -Wno-strict-aliasing -Wempty-body -Wformat
-                           -Wformat-security -Winit-self
+                           -Wformat-security -Wformat-nonliteral -Winit-self
                            -Wdeclaration-after-statement -Wvla
-                           -Wpointer-arith"
+                           -Wpointer-arith -Wmissing-declarations
+                           -Wcast-align
+                           -Wredundant-decls"
 
 AS_CASE([$enable_maintainer_flags],
         [yes],
@@ -952,12 +987,27 @@ dnl === Dependencies, compiler flags and linker libraries =====================
 # strip leading space
 BACKEND_PC_FILES=${BACKEND_PC_FILES#* }
 
-CLUTTER_REQUIRES="$CLUTTER_BASE_PC_FILES $IMAGE_PC_FILES $BACKEND_PC_FILES"
+# public dependencies, will fill the Requires: field of clutter.pc
+CLUTTER_REQUIRES="$CLUTTER_BASE_PC_FILES $BACKEND_PC_FILES"
 PKG_CHECK_MODULES(CLUTTER_DEPS, [$CLUTTER_REQUIRES])
+
+# private dependencies, will fill the Requires.private: field of clutter.pc
+AS_IF([test "x$CLUTTER_BASE_PC_FILES_PRIVATE" = "x" && test "x$BACKEND_PC_FILES_PRIVATE" = "x"],
+      [
+        CLUTTER_REQUIRES_PRIVATE=""
+        CLUTTER_DEPS_PRIVATE_CFLAGS=""
+        CLUTTER_DEPS_PRIVATE_LIBS=""
+      ],
+      [
+        CLUTTER_REQUIRES_PRIVATE="$CLUTTER_BASE_PC_FILES_PRIVATE $BACKEND_PC_FILES_PRIVATE"
+        PKG_CHECK_MODULES(CLUTTER_DEPS_PRIVATE, [$CLUTTER_REQUIRES_PRIVATE])
+      ])
+
 AC_SUBST(CLUTTER_REQUIRES)
+AC_SUBST(CLUTTER_REQUIRES_PRIVATE)
 
-CLUTTER_CFLAGS="$FLAVOUR_CFLAGS $CLUTTER_DEPS_CFLAGS $CLUTTER_PROFILE_CFLAGS $GLIB_CFLAGS"
-CLUTTER_LIBS="$FLAVOUR_LIBS $CLUTTER_DEPS_LIBS $CLUTTER_PROFILE_LDFLAGS $GLIB_LIBS"
+CLUTTER_CFLAGS="$FLAVOUR_CFLAGS $CLUTTER_DEPS_CFLAGS $CLUTTER_DEPS_PRIVATE_CFLAGS $CLUTTER_PROFILE_CFLAGS $GLIB_CFLAGS"
+CLUTTER_LIBS="$FLAVOUR_LIBS $CLUTTER_DEPS_LIBS $CLUTTER_DEPS_PRIVATE_LIBS $CLUTTER_PROFILE_LDFLAGS $GLIB_LIBS"
 AC_SUBST(CLUTTER_CFLAGS)
 AC_SUBST(CLUTTER_LIBS)
 
@@ -1033,6 +1083,27 @@ AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],
                    [The prefix for our gettext translation domains.])
 AS_ALL_LINGUAS
 
+dnl = Build optionals =========================================================
+
+dnl === Conformance test suite ================================================
+
+AC_ARG_ENABLE([conformance],
+              [AS_HELP_STRING([--disable-conformance], [Whether the conformance tests should be built])],
+              [],
+              [enable_conformance=yes])
+
+AC_ARG_ENABLE([tests],
+              [AS_HELP_STRING([--disable-tests], [Whether tests should be built])],
+              [],
+              [enable_tests=yes])
+AM_CONDITIONAL(BUILD_TESTS, [test "x$enable_tests" = "xyes" && test "x$enable_conformance" = "xyes"])
+
+AC_ARG_ENABLE([examples],
+              [AS_HELP_STRING([--disable-examples], [Whether examples should be built])],
+              [],
+              [enable_examples=yes])
+AM_CONDITIONAL(BUILD_EXAMPLES, [test "x$enable_examples" = "xyes"])
+
 dnl ===========================================================================
 
 AC_CONFIG_FILES([
@@ -1050,7 +1121,6 @@ AC_CONFIG_FILES([
        clutter/Makefile
         clutter/clutter-config.h
        clutter/clutter-version.h
-       clutter/clutter-version.h.win32
        clutter/clutter-$CLUTTER_API_VERSION.pc:clutter/clutter.pc.in
 
        clutter/cally/cally-$CLUTTER_API_VERSION.pc:clutter/cally/cally.pc.in
@@ -1067,6 +1137,8 @@ AC_CONFIG_FILES([
        tests/micro-bench/Makefile
        tests/performance/Makefile
 
+        examples/Makefile
+
        doc/Makefile
        doc/reference/Makefile
        doc/reference/clutter/Makefile
@@ -1114,8 +1186,12 @@ echo "        Build Additional Documentation: ${enable_docs} (Generate PDF: ${en
 echo ""
 echo " • Extra:"
 echo "        Build introspection data: ${enable_introspection}"
-echo "        Build conformance test suite: ${enable_conformance}"
+echo "        Build test suites: ${enable_tests}"
+if test "x$enable_tests" = "xyes"; then
 echo "        Build X11-specific tests: ${x11_tests}"
+echo "        Build tests using GDK-Pixbuf: ${pixbuf_tests}"
+fi
+echo "        Build examples: ${enable_examples}"
 
 # Clutter backend related flags
 echo ""
@@ -1137,16 +1213,18 @@ if test "x$SUPPORT_X11" = "x1"; then
 echo ""
 echo "     - X11 backend options:"
 echo "        Enabled extensions: ${X11_EXTS}"
-echo "        Build X11-specific tests: ${x11_tests}"
 fi
 
 if test "x$SUPPORT_CEX100" = "x1"; then
 echo ""
-echo "     - CEx100 backend options:"
+echo "     - CEx100 backend options (WARNING: Experimental):"
 echo "        libGDL include prefix: ${CLUTTER_CEX100_LIBGDL_PREFIX}"
 fi
 
-echo "        Wayland compositor features: ${SUPPORT_WAYLAND_COMPOSITOR}"
+if test "x$SUPPORT_WAYLAND_COMPOSITOR" = "x1"; then
+echo ""
+echo "     - Wayland compositor support enabled (WARNING: Experimental)"
+fi
 
 echo ""