1 # clutter package version number, (as distinct from shared library version)
2 # An odd micro number indicates in-progress development from Git
3 # An even micro number indicates a released version
5 # Making a point release:
6 # - increase clutter_micro_version to the next even number
7 # - increase clutter_interface_age to the next even number
9 # - increase clutter_micro_version to the next odd number
10 # - increase clutter_interface_version to the next odd number
11 m4_define([clutter_major_version], [1])
12 m4_define([clutter_minor_version], [9])
13 m4_define([clutter_micro_version], [1])
15 # • for stable releases: increase the interface age by 1 for each release;
16 # if the API changes, set to 0. interface_age and binary_age are used to
17 # create the soname of the shared object:
19 # (<minor> * 100 + <micro>) - <interface_age>
21 # this allows using the same soname for different micro-releases in case
22 # no API was added or deprecated. for instance:
24 # clutter 1.2.0 -> 100 * 2 + 0 = 200, interface age = 0 -> 200
25 # clutter 1.2.2 -> 100 * 2 + 2 = 202, interface age = 2 -> 200
26 # clutter 1.2.4 -> 100 * 2 + 4 = 204, interface age = 4 -> 200
27 # [ API addition, deprecation ]
28 # clutter 1.2.6 -> 100 * 2 + 6 = 206, interface age = 0 -> 206
29 # clutter 1.2.8 -> 100 * 2 + 8 = 208, interface age = 2 -> 206
30 # clutter 1.2.10 -> 100 * 2 + 10 = 210, interface age = 4 -> 206
33 # • for development releases: keep clutter_interface_age to 0
34 m4_define([clutter_interface_age], [0])
36 m4_define([clutter_binary_age], [m4_eval(100 * clutter_minor_version + clutter_micro_version)])
38 m4_define([clutter_release_status],
39 [m4_if(m4_eval(clutter_micro_version % 2), [1], [git],
40 [m4_if(m4_eval(clutter_minor_version % 2), [1], [snapshot],
43 m4_define([clutter_version], [clutter_major_version.clutter_minor_version.clutter_micro_version])
45 # change this only when breaking the API
46 m4_define([clutter_api_version], [1.0])
52 [http://bugzilla.gnome.org/enter_bug.cgi?product=clutter],
54 [http://www.clutter-project.org])
56 AC_CONFIG_SRCDIR([clutter/clutter.h])
57 AC_CONFIG_HEADERS([config.h])
58 AC_CONFIG_AUX_DIR([build])
59 AC_CONFIG_MACRO_DIR([build/autotools])
61 AM_INIT_AUTOMAKE([1.11 foreign -Wno-portability no-define no-dist-gzip dist-xz tar-ustar])
62 AM_SILENT_RULES([yes])
64 AC_SUBST([CLUTTER_MAJOR_VERSION], [clutter_major_version])
65 AC_SUBST([CLUTTER_MINOR_VERSION], [clutter_minor_version])
66 AC_SUBST([CLUTTER_MICRO_VERSION], [clutter_micro_version])
67 AC_SUBST([CLUTTER_VERSION], [clutter_version])
68 AC_SUBST([CLUTTER_API_VERSION], [clutter_api_version])
69 AC_SUBST([CLUTTER_API_VERSION_AM], [$CLUTTER_MAJOR_VERSION\_0])
70 AC_SUBST([CLUTTER_RELEASE_STATUS], [clutter_release_status])
72 m4_define([lt_current], [m4_eval(100 * clutter_minor_version + clutter_micro_version - clutter_interface_age)])
73 m4_define([lt_revision], [clutter_interface_age])
74 m4_define([lt_age], [m4_eval(clutter_binary_age - clutter_interface_age)])
75 CLUTTER_LT_CURRENT=lt_current
76 CLUTTER_LT_REV=lt_revision
78 CLUTTER_LT_VERSION="$CLUTTER_LT_CURRENT:$CLUTTER_LT_REV:$CLUTTER_LT_AGE"
79 CLUTTER_LT_LDFLAGS="-version-info $CLUTTER_LT_VERSION"
80 AC_SUBST([CLUTTER_LT_CURRENT], [lt_current])
81 AC_SUBST([CLUTTER_LT_REVISION], [lt_revision])
82 AC_SUBST([CLUTTER_LT_VERSION], [$CLUTTER_LT_VERSION])
92 AC_MSG_CHECKING([if building for some Win32 platform])
94 [*-*-mingw*|*-*-cygwin*],
96 CLUTTER_LT_LDFLAGS="$CLUTTER_LT_LDFLAGS -no-undefined"
102 AC_MSG_RESULT([$platform_win32])
104 AM_CONDITIONAL(OS_WIN32, [test "$platform_win32" = "yes"])
106 AC_CHECK_HEADER([OpenGL/gl.h], [platform_quartz=yes], [platform_quartz=no])
107 AM_CONDITIONAL(OS_QUARTZ, [test "$platform_quartz" = "yes"])
109 AC_CHECK_HEADER([GL/glx.h], [platform_glx=yes], [platform_glx=no])
110 AC_CHECK_LIB([GL], [glXCreateContext], [platform_glx=yes], [platform_glx=no])
111 AM_CONDITIONAL(OS_GLX, [test "$platform_glx" = "yes"])
113 AC_SUBST(CLUTTER_LT_LDFLAGS)
115 dnl ========================================================================
117 # Checks for programs.
120 # require libtool >= 2.2
122 LT_INIT([disable-static])
124 # Checks for header files.
127 # required versions for dependencies
128 m4_define([glib_req_version], [2.31.0])
129 m4_define([cogl_req_version], [1.9.1])
130 m4_define([json_glib_req_version], [0.12.0])
131 m4_define([atk_req_version], [2.1.5])
132 m4_define([cairo_req_version], [1.10])
133 m4_define([pango_req_version], [1.20])
134 m4_define([gi_req_version], [0.9.5])
135 m4_define([uprof_req_version], [0.3])
136 m4_define([gtk_doc_req_version], [1.15])
137 m4_define([xfixes_req_version], [3])
138 m4_define([xcomposite_req_version], [0.4])
140 AC_SUBST([GLIB_REQ_VERSION], [glib_req_version])
141 AC_SUBST([COGL_REQ_VERSION], [cogl_req_version])
142 AC_SUBST([JSON_GLIB_REQ_VERSION], [json_glib_req_version])
143 AC_SUBST([ATK_REQ_VERSION], [atk_req_version])
144 AC_SUBST([CAIRO_REQ_VERSION], [cairo_req_version])
145 AC_SUBST([PANGO_REQ_VERSION], [pango_req_version])
146 AC_SUBST([GI_REQ_VERSION], [gi_req_version])
147 AC_SUBST([UPROF_REQ_VERSION], [uprof_req_version])
148 AC_SUBST([GTK_DOC_REQ_VERSION], [gtk_doc_req_version])
149 AC_SUBST([XFIXES_REQ_VERSION], [xfixes_req_version])
150 AC_SUBST([XCOMPOSITE_REQ_VERSION], [xcomposite_req_version])
152 # Checks for typedefs, structures, and compiler characteristics.
153 AM_PATH_GLIB_2_0([glib_req_version],
155 [AC_MSG_ERROR([glib-2.0 is required])],
156 [gobject gthread gmodule-no-export])
158 # Check for -Bsymbolic-functions to avoid intra-library PLT jumps
159 AC_ARG_ENABLE([Bsymbolic],
160 [AS_HELP_STRING([--disable-Bsymbolic],
161 [Avoid linking with -Bsymbolic])],
164 saved_LDFLAGS="${LDFLAGS}"
165 AC_MSG_CHECKING([for -Bsymbolic-functions linker flag])
166 LDFLAGS=-Wl,-Bsymbolic-functions
167 AC_TRY_LINK([], [int main (void) { return 0; }],
176 LDFLAGS="${saved_LDFLAGS}"
179 AS_IF([test "x$enable_Bsymbolic" = "xyes"], [CLUTTER_LINK_FLAGS=-Wl[,]-Bsymbolic-functions])
180 AC_SUBST(CLUTTER_LINK_FLAGS)
182 dnl ========================================================================
185 AS_IF([test "x$platform_win32" = "xyes"], [CLUTTER_FLAVOUR=win32],
186 [test "x$platform_quartz" = "xyes"], [CLUTTER_FLAVOUR=osx],
187 [CLUTTER_FLAVOUR=glx])
193 experimental_backend=no
195 # base dependencies for core
196 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"
198 # backend specific pkg-config files
201 dnl === Clutter windowing system backend ======================================
204 [AS_HELP_STRING([--enable-x11=@<:@yes/no@:>@], [Enable the X11 backend (default=no)])],
207 AC_ARG_ENABLE([win32],
208 [AS_HELP_STRING([--enable-win32=@<:@yes/no@:>@], [Enable the Windows backend (default=no)])],
210 [enable_win32=maybe])
212 [AS_HELP_STRING([--enable-osx=@<:@yes/no@:>@], [Enable the OS X backend (default=no)])],
216 [AS_HELP_STRING([--enable-gdk=@<:@yes/no@:>@], [Enable the GDK backend (default=no)])],
219 AC_ARG_ENABLE([wayland],
220 [AS_HELP_STRING([--enable-wayland=@<:@yes/no@:>@], [Enable the Wayland client backend (default=no)])],
224 [AS_HELP_STRING([--enable-egl=@<:@yes/no@:>@], [Enable the EGL framebuffer backend (default=no)])]
228 dnl Define default values
229 AS_IF([test "x$platform_glx" = "xyes"], [enable_x11=yes])
230 AS_IF([test "x$platform_win32" = "xyes"], [enable_win32=yes])
231 AS_IF([test "x$platform_quartz" = "xyes"], [enable_osx=yes])
233 dnl Per-backend rules
234 AS_IF([test "x$enable_x11" = "xyes"],
236 CLUTTER_BACKENDS="$CLUTTER_BACKENDS x11"
242 # Mesa 7.3 added a GL pkg-config file, finally, but if a pkg-config
243 # file isn't found just add -lGL and hope for the best.
244 PKG_CHECK_EXISTS([gl],
245 [BACKEND_PC_FILES="$BACKEND_PC_FILES gl"],
246 [FLAVOUR_LIBS="$FLAVOUR_LIBS -lGL"])
248 # if Mesa has support for egl, we can use it as well
249 PKG_CHECK_EXISTS([egl],
251 BACKEND_PC_FILES="$BACKEND_PC_FILES egl"
256 # We might fall back to DRM for sync-to-vblank on GLX
257 PKG_CHECK_EXISTS([libdrm],
259 AC_DEFINE([HAVE_DRM], [1], [Have libdrm support])
260 BACKEND_PC_FILES="$BACKEND_PC_FILES libdrm"
264 # we use fontconfig API and pango-fc when the fontconfig
265 # configuration changes
266 PKG_CHECK_EXISTS([pangoft2],
268 AC_DEFINE([HAVE_PANGO_FT2], [1], [Supports PangoFt2])
269 BACKEND_PC_FILES="$BACKEND_PC_FILES pangoft2"
273 AC_DEFINE([HAVE_CLUTTER_GLX], [1], [Have the GLX backend])
276 AS_IF([test "x$enable_gdk" = "xyes"],
278 CLUTTER_BACKENDS="$CLUTTER_BACKENDS gdk"
283 BACKEND_PC_FILES="$BACKEND_PC_FILES gdk-3.0"
284 PKG_CHECK_EXISTS([gl], [BACKEND_PC_FILES="$BACKEND_PC_FILES gl"], [])
287 AS_IF([test "x$enable_wayland" = "xyes"],
289 CLUTTER_BACKENDS="$CLUTTER_BACKENDS wayland"
291 experimental_backend="yes"
295 PKG_CHECK_EXISTS([gl], [BACKEND_PC_FILES="$BACKEND_PC_FILES gl"], [])
296 PKG_CHECK_EXISTS([egl], [BACKEND_PC_FILES="$BACKEND_PC_FILES egl"], [])
297 PKG_CHECK_EXISTS([wayland-client xkbcommon],
298 [BACKEND_PC_FILES="$BACKEND_PC_FILES wayland-client xkbcommon"],
301 AC_DEFINE([HAVE_CLUTTER_WAYLAND], [1], [Have the Wayland backend])
304 AS_IF([test "x$enable_egl" = "xyes"],
306 CLUTTER_BACKENDS="$CLUTTER_BACKENDS egl"
312 [AS_HELP_STRING([--with-tslib=@<:@yes/no@:>@], [Use TSLib for events])],
317 [AS_HELP_STRING([--with-evdev=@<:@yes/no@:>@], [Use evdev for events])],
322 [AS_HELP_STRING([--with-gdl=@<:@yes/no@:>@], [Use libgdl for CE3100/CE4100 support])],
326 AS_IF([test "x$with_tslib" = "xyes"],
328 PKG_CHECK_MODULES(TSLIB, [tslib-1.0], [have_tslib=yes], [have_tslib=no])
329 AS_IF([test "x$have_tslib" = "xyes"],
331 AC_DEFINE([HAVE_TSLIB], [1], [Have tslib for touchscreen handling])
335 AS_IF([test "x$with_evdev" = "xyes"],
337 PKG_CHECK_MODULES(EVDEV, [gudev-1.0 xkbcommon], [have_evdev=yes], [have_evdev=no])
338 AS_IF([test "x$have_evdev" = "xyes"],
340 AC_DEFINE([HAVE_EVDEV], [1], [Have evdev support for input handling])
344 AS_IF([test "x$with_gdl" = "xyes"],
348 AC_CHECK_HEADERS([libgdl.h], [have_gdl=yes])
350 AS_IF([test "x$have_gdl" = "xno"],
352 AC_CHECK_HEADERS([CE4100/libgdl.h],
354 FLAVOUR_CFLAGS="-I/usr/include/CE4100"
356 CLUTTER_CEX100_LIBGDL_PREFIX=CE4100/
360 AC_SUBST(CLUTTER_CEX100_LIBGDL_PREFIX)
362 AS_IF([test "x$have_gdl" = "xno"], [AC_MSG_ERROR([libgdl.h not found])])
364 FLAVOUR_LIBS="$FLAVOUR_LIBS -lgdl"
366 SUPPORT_EGL_PLATFORM_GDL=1
368 AC_DEFINE([CLUTTER_EGL_BACKEND_CEX100], [1], [Use CEX100 EGL backend])
371 # Make sure we don't enable tslib and evdev at the same time, we
372 # don't support multiple event backends yet.
373 AS_IF([test "x$have_tslib" = "xyes" -a "x$have_evdev" = "xyes"],
375 AC_MSG_ERROR([Cannot enable both tslib and evdev events])
378 FLAVOUR_LIBS="$FLAVOUR_LIBS $TSLIB_LIBS $EVDEV_LIBS"
379 FLAVOUR_CFLAGS="$FLAVOUR_CFLAGS $TSLIB_CFLAGS $EVDEV_CFLAGS"
381 AC_DEFINE([CLUTTER_EGL_BACKEND_GENERIC], [1], [Use Generic EGL backend])
383 AC_DEFINE([HAVE_CLUTTER_EGL], [1], [Have the EGL backend])
386 AS_IF([test "x$enable_osx" = "xyes"],
388 CLUTTER_BACKENDS="$CLUTTER_BACKENDS osx"
390 AC_DEFINE([HAVE_CLUTTER_OSX], [1], [Have the OSX backend])
392 FLAVOUR_LIBS="$FLAVOUR_LIBS -framework Cocoa -framework OpenGL"
397 AS_IF([test "x$enable_win32" = "xyes"],
399 CLUTTER_BACKENDS="$CLUTTER_BACKENDS win32"
401 AC_DEFINE([HAVE_CLUTTER_WIN32], [1], [Have the Win32 backend])
403 FLAVOUR_LIBS="$FLAVOUR_LIBS -lopengl32 -lgdi32 -lwinmm"
404 FLAVOUR_CFLAGS="$FLAVOUR_CFLAGS -D_WIN32_WINNT=0x0500"
406 AC_CHECK_TOOL(WINDRES, [windres], [AC_MSG_ERROR([*** windres is required])])
411 AS_IF([test "x$CLUTTER_BACKENDS" = "x"],
413 AC_MSG_ERROR([No backend enabled. You need to enable at least one backend.])
416 # conditionals for use in automake files...
417 AM_CONDITIONAL(SUPPORT_GLX, [test "x$SUPPORT_GLX" = "x1"])
418 AM_CONDITIONAL(SUPPORT_X11, [test "x$SUPPORT_X11" = "x1"])
419 AM_CONDITIONAL(SUPPORT_GDK, [test "x$SUPPORT_GDK" = "x1"])
420 AM_CONDITIONAL(SUPPORT_EGL, [test "x$SUPPORT_EGL" = "x1"])
421 AM_CONDITIONAL(SUPPORT_OSX, [test "x$SUPPORT_OSX" = "x1"])
422 AM_CONDITIONAL(SUPPORT_WIN32, [test "x$SUPPORT_WIN32" = "x1"])
423 AM_CONDITIONAL(SUPPORT_CEX100, [test "x$SUPPORT_EGL_PLATFORM_GDL" = "x1"])
424 AM_CONDITIONAL(SUPPORT_WAYLAND, [test "x$SUPPORT_WAYLAND" = "x1"])
425 AM_CONDITIONAL(SUPPORT_STUB, [test "x$SUPPORT_WIN32" = "x1" -o \
426 "x$SUPPORT_OSX" = "x1" -o \
427 "x$SUPPORT_WAYLAND" = "x1"])
429 AM_CONDITIONAL(USE_COGL, [test "x$SUPPORT_COGL" = "x1"])
430 AM_CONDITIONAL(USE_TSLIB, [test "x$have_tslib" = "xyes"])
431 AM_CONDITIONAL(USE_EVDEV, [test "x$have_evdev" = "xyes"])
432 AM_CONDITIONAL(USE_GLD, [test "x$have_gdl" = "xyes"])
434 dnl Instead of using AM_CFLAGS to ensure
435 dnl COGL_ENABLE_EXPERIMENTAL_2_0_API is defined while compiling clutter
436 dnl and cogl code we use a define in config.h instead. This helps ensure
437 dnl other tools such as glib-mkenums and gir-scanner don't end up
438 dnl using the define also.
439 AC_DEFINE([COGL_ENABLE_EXPERIMENTAL_2_0_API], [1], [Can use Cogl 2.0 API internally])
441 dnl strip leading spaces
442 CLUTTER_BACKENDS=${CLUTTER_BACKENDS#* }
443 AC_SUBST(CLUTTER_BACKENDS)
445 dnl === Clutter configuration =================================================
447 CLUTTER_CONFIG_DEFINES=
450 AS_IF([test "x$SUPPORT_X11" = "x1"],
451 [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
452 #define CLUTTER_WINDOWING_X11 1"])
453 AS_IF([test "x$SUPPORT_GDK" = "x1"],
454 [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
455 #define CLUTTER_WINDOWING_GDK 1"])
456 AS_IF([test "x$SUPPORT_GLX" = "x1"],
457 [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
458 #define CLUTTER_WINDOWING_GLX 1"])
459 AS_IF([test "x$SUPPORT_EGL" = "x1"],
460 [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
461 #define CLUTTER_WINDOWING_EGL 1"])
462 AS_IF([test "x$SUPPORT_WAYLAND" = "x1"],
463 [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
464 #define CLUTTER_WINDOWING_WAYLAND 1"])
465 AS_IF([test "x$SUPPORT_OSX" = "x1"],
466 [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
467 #define CLUTTER_WINDOWING_OSX 1"])
468 AS_IF([test "x$SUPPORT_WIN32" = "x1"],
469 [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
470 #define CLUTTER_WINDOWING_WIN32 1"])
471 AS_IF([test "x$SUPPORT_EGL_PLATFORM_GDL" = "x1"],
472 [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
473 #define CLUTTER_WINDOWING_CEX100 1"])
475 AC_SUBST([CLUTTER_CONFIG_DEFINES])
477 dnl === Clutter substitutions kept for backwards compatibility ================
478 AC_SUBST([CLUTTER_WINSYS], [deprecated])
479 AC_SUBST([CLUTTER_WINSYS_BASE], [deprecated])
480 AC_SUBST([CLUTTER_STAGE_TYPE], [deprecated])
481 AC_SUBST([CLUTTER_SONAME_INFIX], [deprecated])
482 AC_SUBST([CLUTTER_FLAVOUR], [deprecated])
483 AC_SUBST([CLUTTER_COGL], [deprecated])
484 AC_SUBST([COGL_DRIVER], [deprecated])
486 dnl === Image loading backend =================================================
489 dnl === X11 checks, only for X11-based backends ===============================
493 AS_IF([test "x$SUPPORT_X11" = "x1"],
495 # base X11 includes and libraries
496 AC_MSG_CHECKING([for X11])
498 # start with pkg-config
499 PKG_CHECK_EXISTS([x11], [have_x11=yes], [have_x11=no])
500 AS_IF([test "x$have_x11" = "xyes"],
504 # we actually need to ask for CFLAGS and LIBS
505 X11_CFLAGS=`$PKG_CONFIG --cflags $X11_PC_FILES`
506 X11_LIBS=`$PKG_CONFIG --libs $X11_PC_FILES`
508 AC_MSG_RESULT([found])
511 # no pkg-config, let's go old school
514 AS_IF([test "x$no_x" = "xyes"],
515 [AC_MSG_ERROR([No X11 Libraries found])],
517 AS_IF([test "x$x_includes" != "xNONE" && test -n "$x_includes"],
518 [X11_CFLAGS=-I`echo $x_includes | sed -e "s/:/ -I/g"`])
520 AS_IF([test "x$x_libraries" != "xNONE" && test -n "$x_libraries"],
521 [X11_LIBS=-L`echo $x_libraries | sed -e "s/:/ -L/g"`])
523 AC_MSG_RESULT([found])
530 AC_MSG_CHECKING([for XEXT extension])
531 PKG_CHECK_EXISTS([xext], [have_xext=yes], [have_xext=no])
532 AS_IF([test "x$have_xext" = "xyes"],
534 AC_DEFINE(HAVE_XEXT, [1], [Define to 1 if we have the XEXT X extension])
536 X11_LIBS="$X11_LIBS -lXext"
537 X11_PC_FILES="$X11_PC_FILES xext"
539 AC_MSG_RESULT([found])
541 [AC_MSG_ERROR([Not found])]
545 AC_MSG_CHECKING([for XFIXES extension >= $XFIXES_REQ_VERSION])
546 PKG_CHECK_EXISTS([xfixes >= $XFIXES_REQ_VERSION], [have_xfixes=yes], [have_xfixes=no])
547 AS_IF([test "x$have_xfixes" = "xyes"],
549 AC_DEFINE(HAVE_XFIXES, [1], [Define to 1 if we have the XFIXES X extension])
551 X11_LIBS="$X11_LIBS -lXfixes"
552 X11_PC_FILES="$X11_PC_FILES xfixes >= $XFIXES_REQ_VERSION"
554 AC_MSG_RESULT([found])
556 [AC_MSG_ERROR([Not found])]
560 AC_MSG_CHECKING([for XDAMAGE extension])
561 PKG_CHECK_EXISTS([xdamage], [have_xdamage=yes], [have_xdamage=no])
562 AS_IF([test "x$have_xdamage" = "xyes"],
564 AC_DEFINE(HAVE_XDAMAGE, [1], [Define to 1 if we have the XDAMAGE X extension])
566 X11_LIBS="$X11_LIBS -lXdamage"
567 X11_PC_FILES="$X11_PC_FILES xdamage"
569 AC_MSG_RESULT([found])
571 [AC_MSG_ERROR([not found])]
574 # XCOMPOSITE (optional)
575 AC_MSG_CHECKING([for XCOMPOSITE extension >= $XCOMPOSITE_REQ_VERSION])
576 PKG_CHECK_EXISTS([xcomposite >= $XCOMPOSITE_REQ_VERSION], [have_xcomposite=yes], [have_xcomposite=no])
577 AS_IF([test "x$have_xcomposite" = "xyes"],
579 AC_DEFINE(HAVE_XCOMPOSITE, [1], [Define to 1 if we have the XCOMPOSITE X extension])
581 X11_LIBS="$X11_LIBS -lXcomposite"
582 X11_PC_FILES="$X11_PC_FILES xcomposite >= $XCOMPOSITE_REQ_VERSION"
584 AC_MSG_RESULT([found])
586 [AC_MSG_ERROR([not found])]
589 # X Generic Extensions (optional)
590 clutter_save_CPPFLAGS="$CPPFLAGS"
591 CPPFLAGS="$CPPFLAGS $X11_CFLAGS"
593 clutter_save_LIBS="$LIBS"
594 LIBS="$LIBS $X11_LIBS"
597 AC_CHECK_FUNC([XGetEventData],
599 AC_DEFINE([HAVE_XGE], [1], [Define to 1 if X Generic Extensions is available])
603 CPPFLAGS="$clutter_save_CPPFLAGS"
604 LIBS="$clutter_save_LIBS"
607 AC_ARG_ENABLE([xinput],
608 [AS_HELP_STRING([--enable-xinput], [Use the XI X extension])],
612 AS_IF([test "x$enable_xinput" = "xyes"],
614 PKG_CHECK_EXISTS([xi], [have_xinput=yes], [have_xinput=no])
620 AS_CASE([$have_xinput],
624 AC_CHECK_HEADERS([X11/extensions/XInput2.h],
627 AC_DEFINE([HAVE_XINPUT_2],
629 [Define to 1 if XI2 is available])
633 AC_DEFINE([HAVE_XINPUT],
635 [Define to 1 if XInput is available])
638 X11_LIBS="$X11_LIBS $XINPUT_LIBS"
639 X11_PC_FILES="$X11_PC_FILES xi"
646 [AC_MSG_ERROR([Invalid argument for --enable-xinput])]
650 clutter_save_CPPFLAGS="$CPPFLAGS"
651 CPPFLAGS="$CPPFLAGS $X11_CFLAGS"
653 clutter_save_LIBS="$LIBS"
654 LIBS="$LIBS $X11_LIBS"
657 AC_CHECK_FUNC([XkbQueryExtension],
659 AC_DEFINE(HAVE_XKB, 1, [Define to use XKB extension])
663 CPPFLAGS="$clutter_save_CPPFLAGS"
664 LIBS="$clutter_save_LIBS"
667 BACKEND_PC_FILES="$BACKEND_PC_FILES $X11_PC_FILES"
668 FLAVOUR_LIBS="$FLAVOUR_LIBS $X11_LIBS"
669 FLAVOUR_CFLAGS="$FLAVOUR_CFLAGS $X11_CFLAGS"
673 AM_CONDITIONAL([BUILD_XI2], [test "x$have_xinput2" = "xyes"])
674 AM_CONDITIONAL([X11_TESTS], [test "x$x11_tests" = "xyes"])
676 dnl === Enable debug level ====================================================
678 m4_define([debug_default], [m4_if(m4_eval(clutter_minor_version % 2), [1], [yes], [minimum])])
679 AC_ARG_ENABLE([debug],
680 [AS_HELP_STRING([--enable-debug=@<:@no/minimum/yes@:>@],
681 [Control Clutter debugging level @<:@default=]debug_default[@:>@])],
683 [enable_debug=debug_default])
685 AS_CASE([$enable_debug],
689 test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
690 CLUTTER_DEBUG_CFLAGS="-DCLUTTER_ENABLE_DEBUG"
694 [CLUTTER_DEBUG_CFLAGS="-DCLUTTER_ENABLE_DEBUG -DG_DISABLE_CAST_CHECKS"],
697 [CLUTTER_DEBUG_CFLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"],
699 [AC_MSG_ERROR([Unknown argument for --enable-debug])]
702 AC_SUBST(CLUTTER_DEBUG_CFLAGS)
704 dnl === Enable deprecation guards ==================================================
706 m4_define([deprecated_default],
707 [m4_if(m4_eval(clutter_minor_version % 2),
712 AC_ARG_ENABLE([deprecated],
713 [AS_HELP_STRING([--enable-deprecated=@<:@no/yes@:>@],
714 [Whether deprecated symbols should be disabled when compiling Clutter @<:@default=]deprecated_default[@:>@])],
716 [enable_deprecated=deprecated_default])
718 AS_CASE([$enable_deprecated],
722 CLUTTER_DEPRECATED_CFLAGS="-DG_DISABLE_SINGLE_INCLUDES -DCOGL_DISABLE_DEPRECATED -DCLUTTER_DISABLE_DEPRECATED"
727 CLUTTER_DEPRECATED_CFLAGS="-DGLIB_DISABLE_DEPRECATION_WARNINGS -DCLUTTER_DISABLE_DEPRECATION_WARNINGS"
730 [AC_MSG_ERROR([Unknown argument for --enable-deprecated])]
733 AC_SUBST([CLUTTER_DEPRECATED_CFLAGS])
736 dnl === Conformance test suite ================================================
738 AC_ARG_ENABLE([conformance],
739 [AS_HELP_STRING([--enable-conformance=@<:@no/yes@:>@],
740 [Build conformance test suite @<:@default=yes@:>@])],
742 [enable_conformance=yes])
744 AM_CONDITIONAL([BUILD_TESTS], [test "x$enable_conformance" = "xyes"])
746 dnl === Profiling =============================================================
748 m4_define([profile_default], [no])
749 AC_ARG_ENABLE(profile,
750 AS_HELP_STRING([--enable-profile=@<:@no/yes@:>@],
751 [Turn on profiling support. yes; All profiling probe points are compiled in and may be runtime enabled. no; No profiling support will built into clutter. @<:@default=no@:>@]),
753 [enable_profile=profile_default])
755 AS_CASE([$enable_profile],
759 AS_IF([test "x$GCC" = "xyes"],
761 PKG_CHECK_MODULES([PROFILE_DEP], [uprof-0.3])
762 CLUTTER_PROFILE_CFLAGS="-DCLUTTER_ENABLE_PROFILE $PROFILE_DEP_CFLAGS"
763 CLUTTER_PROFILE_LDFLAGS="$PROFILE_DEP_LIBS"
765 AS_IF([test "x$enable_debug" = "xyes"], [CLUTTER_PROFILE_CFLAGS+=" -DUPROF_DEBUG"])
768 AC_MSG_ERROR([--enable-profile is currently only supported if using GCC])
774 CLUTTER_PROFILE_CFLAGS=""
775 CLUTTER_PROFILE_LDFLAGS=""
778 [*], [AC_MSG_ERROR([Invalid value for --enable-profile])]
780 AM_CONDITIONAL(PROFILE, test "x$enable_profile" != "xno")
781 AC_SUBST(CLUTTER_PROFILE_CFLAGS)
782 AC_SUBST(CLUTTER_PROFILE_LDFLAGS)
784 dnl === Coverage report =======================================================
786 AC_PATH_PROG([GCOV], [gcov], [enable_gcov=no])
788 AC_MSG_CHECKING([whether to build with gcov testing])
790 AC_ARG_ENABLE([gcov],
791 [AS_HELP_STRING([--enable-gcov],
792 [Whether to enable coverage testing (requires gcc
797 AS_IF([test "x$enable_gcov" = "xyes" && test "x$GCC" = "xyes"],
799 AS_IF([test "x$enable_conformance" = "xno"],
800 [AC_MSG_WARN([Conformance test suite is disabled, the coverage report will be incomplete])],
801 [AC_MSG_RESULT([yes])]
804 GCOV_CFLAGS="-g -O0 -fprofile-arcs -ftest-coverage"
805 GCOV_LDFLAGS="-lgcov"
807 [AC_MSG_RESULT([no])]
810 AM_CONDITIONAL([GCOV_ENABLED], [test "x$enable_gcov" = "xyes"])
811 AC_SUBST([GCOV_CFLAGS])
812 AC_SUBST([GCOV_LDFLAGS])
814 dnl === Enable strict compiler flags ==========================================
816 # use strict compiler flags only when building from git; the rules for
817 # distcheck will take care of turning this on when making a release
818 m4_define([maintainer_flags_default], [m4_if(m4_eval(clutter_micro_version % 2), [1], [yes], [no])])
819 AC_ARG_ENABLE([maintainer-flags],
820 [AS_HELP_STRING([--enable-maintainer-flags=@<:@no/yes/error@:>@],
821 [Use strict compiler flags @<:@default=]maintainer_flags_default[@:>@])],
823 [enable_maintainer_flags=maintainer_flags_default])
825 MAINTAINER_COMPILER_FLAGS="-Wall -Wshadow -Wcast-align -Wuninitialized
826 -Wno-strict-aliasing -Wempty-body -Wformat
827 -Wformat-security -Winit-self
828 -Wdeclaration-after-statement -Wvla
831 AS_CASE([$enable_maintainer_flags],
834 AS_COMPILER_FLAGS([MAINTAINER_CFLAGS], [$MAINTAINER_COMPILER_FLAGS])
843 MAINTAINER_COMPILER_FLAGS="$MAINTAINER_COMPILER_FLAGS -Werror"
844 AS_COMPILER_FLAGS([MAINTAINER_CFLAGS], [$MAINTAINER_COMPILER_FLAGS])
848 [AC_MSG_ERROR([Invalid option for --enable-maintainer-flags])]
851 # strip leading spaces
852 MAINTAINER_CFLAGS=${MAINTAINER_CFLAGS#* }
853 AC_SUBST(MAINTAINER_CFLAGS)
855 dnl === Dependencies, compiler flags and linker libraries =====================
856 # strip leading space
857 BACKEND_PC_FILES=${BACKEND_PC_FILES#* }
859 CLUTTER_REQUIRES="$CLUTTER_BASE_PC_FILES $IMAGE_PC_FILES $BACKEND_PC_FILES"
860 PKG_CHECK_MODULES(CLUTTER_DEPS, [$CLUTTER_REQUIRES])
861 AC_SUBST(CLUTTER_REQUIRES)
863 CLUTTER_CFLAGS="$FLAVOUR_CFLAGS $CLUTTER_DEPS_CFLAGS $CLUTTER_PROFILE_CFLAGS $GLIB_CFLAGS"
864 CLUTTER_LIBS="$FLAVOUR_LIBS $CLUTTER_DEPS_LIBS $CLUTTER_PROFILE_LDFLAGS $GLIB_LIBS"
865 AC_SUBST(CLUTTER_CFLAGS)
866 AC_SUBST(CLUTTER_LIBS)
869 dnl === GObject-Introspection check ===========================================
871 GOBJECT_INTROSPECTION_CHECK([gi_req_version])
873 dnl === GTK Doc check =========================================================
875 GTK_DOC_CHECK([gtk_doc_req_version], [--flavour no-tmpl])
877 # we don't want to build the documentation from a Git clone unless we
878 # explicitly tell configure to do so; this allows avoiding to recurse into
879 # the documentation directory when building Clutter inside Poky for a
880 # target device that doesn't have gtk-doc installed. for reference
881 # see: http://bugzilla.openedhand.com/show_bug.cgi?id=1047
883 # we use autogen.sh as it exists only inside the Git clones, and it
884 # is not packaged into tarballs.
885 AM_CONDITIONAL([BUILD_GTK_DOC], [test "x$enable_gtk_doc" = "xyes" || test ! -f "autogen.sh"])
887 # prefixes for fixing gtk-doc references
888 CAIRO_PREFIX="`$PKG_CONFIG --variable=prefix cairo`"
889 GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
890 PANGO_PREFIX="`$PKG_CONFIG --variable=prefix pango`"
891 COGL_PREFIX="`$PKG_CONFIG --variable=prefix cogl-1.0`"
892 ATK_PREFIX="`$PKG_CONFIG --variable=prefix atk`"
893 AC_SUBST(CAIRO_PREFIX)
894 AC_SUBST(GLIB_PREFIX)
895 AC_SUBST(PANGO_PREFIX)
896 AC_SUBST(COGL_PREFIX)
899 dnl === Manual ================================================================
901 AC_ARG_ENABLE([docs],
902 [AS_HELP_STRING([--enable-docs=@<:@no/yes@:>@],
903 [Build optional documentation; requires xsltproc and jw.])],
904 [enable_docs=$enableval],
908 AS_IF([test "x$enable_docs" = "xyes"],
910 AC_PATH_PROG(JW, [jw], [no])
911 AS_IF([test "x$JW" = "xno"],
913 AC_MSG_WARN([jw not found; pdf generation has been disabled])
917 AC_PATH_PROG(XSLTPROC, [xsltproc], [no])
918 AS_IF([test "x$XSLTPROC" = "xno"],
920 AC_MSG_ERROR([xsltproc not found])
925 AM_CONDITIONAL(ENABLE_DOCS, [test "x$enable_docs" = "xyes"])
926 AM_CONDITIONAL(ENABLE_PDFS, [test "x$enable_pdfs" = "xyes"])
928 dnl === I18N ==================================================================
930 AM_GNU_GETTEXT_VERSION([0.17])
931 AM_GNU_GETTEXT([external])
933 GETTEXT_PACKAGE="clutter-1.0"
934 AC_SUBST(GETTEXT_PACKAGE)
935 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],
936 ["$GETTEXT_PACKAGE"],
937 [The prefix for our gettext translation domains.])
940 dnl ===========================================================================
948 build/autotools/Makefile
952 clutter/clutter-config.h
953 clutter/clutter-version.h
954 clutter/clutter-$CLUTTER_API_VERSION.pc:clutter/clutter.pc.in
956 clutter/cally/cally-$CLUTTER_API_VERSION.pc:clutter/cally/cally.pc.in
958 clutter/egl/clutter-cex100.h
961 tests/accessibility/Makefile
962 tests/conform/Makefile
963 tests/conform/test-launcher.sh
965 tests/interactive/Makefile
966 tests/interactive/wrapper.sh
967 tests/micro-bench/Makefile
968 tests/performance/Makefile
971 doc/reference/Makefile
972 doc/reference/clutter/Makefile
973 doc/reference/clutter/clutter-docs.xml
974 doc/reference/cally/Makefile
975 doc/reference/cally/cally-docs.xml
977 doc/cookbook/Makefile
978 doc/cookbook/clutter-cookbook.xml
979 doc/cookbook/examples/Makefile
986 dnl === Summary ===============================================================
989 echo "Clutter - $VERSION (${CLUTTER_RELEASE_STATUS})"
994 echo " Prefix: ${prefix}"
995 echo " Libdir: ${libdir}"
996 echo " Sysconfdir: ${sysconfdir}"
998 # Compiler/Debug related flags
1000 echo " • Compiler options:"
1001 echo " Clutter debug level: ${enable_debug}"
1002 echo " Compiler flags: ${CFLAGS} ${MAINTAINER_CFLAGS}"
1003 echo " Profiling enabled: ${enable_profile}"
1004 echo " Enable coverage tests: ${enable_gcov}"
1005 echo " Enable deprecated symbols: ${enable_deprecated}"
1009 echo " • Documentation:"
1010 echo " Build API Reference: ${enable_gtk_doc}"
1011 echo " Build Additional Documentation: ${enable_docs} (Generate PDF: ${enable_pdfs})"
1016 echo " Build introspection data: ${enable_introspection}"
1017 echo " Build conformance test suite: ${enable_conformance}"
1018 echo " Build X11-specific tests: ${x11_tests}"
1020 # Clutter backend related flags
1022 echo " • Clutter Backends:"
1024 if test "x$experimental_backend" = "xno"; then
1025 echo " Windowing systems: ${CLUTTER_BACKENDS}"
1027 echo " Windowing systems: ${CLUTTER_BACKENDS} (WARNING: Experimental backends enabled)"
1030 if test "x$SUPPORT_X11" = "x1"; then
1032 echo " Enable XComposite: ${have_xcomposite}"
1033 echo " Enable XInput: ${have_xinput}"
1034 echo " Enable Xge: ${have_xge}"
1035 echo " Enable XI2: ${have_xinput2}"
1036 echo " Enable XKB: ${have_xkb}"
1039 if test "x$SUPPORT_EGL" = "x1"; then
1041 echo " Enable TSLib: ${have_tslib}"
1042 echo " Enable evdev: ${have_evdev}"
1043 echo " Enable GDL: ${have_gdl}"
1048 # General warning about experimental features
1049 if test "x$experimental_backend" = "xyes"; then
1051 echo "☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠"
1054 echo " The stability of your build might be affected by one or more"
1055 echo " experimental backends or experimental and unsupported features"
1056 echo "☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠"