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)])],
222 [enable_wayland=maybe])
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 # We might fall back to DRM for sync-to-vblank on GLX
249 PKG_CHECK_EXISTS([libdrm],
251 AC_DEFINE([HAVE_DRM], [1], [Have libdrm support])
252 BACKEND_PC_FILES="$BACKEND_PC_FILES libdrm"
256 # we use fontconfig API and pango-fc when the fontconfig
257 # configuration changes
258 PKG_CHECK_EXISTS([pangoft2],
260 AC_DEFINE([HAVE_PANGO_FT2], [1], [Supports PangoFt2])
261 BACKEND_PC_FILES="$BACKEND_PC_FILES pangoft2"
265 AC_DEFINE([HAVE_CLUTTER_GLX], [1], [Have the GLX backend])
268 AS_IF([test "x$enable_gdk" = "xyes"],
270 CLUTTER_BACKENDS="$CLUTTER_BACKENDS gdk"
275 BACKEND_PC_FILES="$BACKEND_PC_FILES gdk-3.0"
276 PKG_CHECK_EXISTS([gl], [BACKEND_PC_FILES="$BACKEND_PC_FILES gl"], [])
279 AS_IF([test "x$enable_wayland" = "xyes"],
281 CLUTTER_BACKENDS="$CLUTTER_BACKENDS wayland"
283 experimental_backend="yes"
288 PKG_CHECK_EXISTS([gl], [BACKEND_PC_FILES="$BACKEND_PC_FILES gl"], [])
289 PKG_CHECK_EXISTS([egl], [BACKEND_PC_FILES="$BACKEND_PC_FILES egl"], [])
290 PKG_CHECK_EXISTS([wayland-client xkbcommon],
291 [BACKEND_PC_FILES="$BACKEND_PC_FILES wayland-client xkbcommon"],
294 AC_DEFINE([HAVE_CLUTTER_WAYLAND], [1], [Have the Wayland backend])
297 AS_IF([test "x$enable_egl" = "xyes"],
299 CLUTTER_BACKENDS="$CLUTTER_BACKENDS egl"
304 # if Mesa has support for egl, we can use it as well
305 PKG_CHECK_EXISTS([egl],
307 BACKEND_PC_FILES="$BACKEND_PC_FILES 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])
337 AS_IF([test "x$with_evdev" = "xyes"],
339 PKG_CHECK_MODULES(EVDEV, [gudev-1.0 xkbcommon], [have_evdev=yes], [have_evdev=no])
340 AS_IF([test "x$have_evdev" = "xyes"],
342 AC_DEFINE([HAVE_EVDEV], [1], [Have evdev support for input handling])
348 AS_IF([test "x$with_gdl" = "xyes"],
352 AC_CHECK_HEADERS([libgdl.h], [have_gdl=yes])
354 AS_IF([test "x$have_gdl" = "xno"],
356 AC_CHECK_HEADERS([CE4100/libgdl.h],
358 FLAVOUR_CFLAGS="-I/usr/include/CE4100"
360 CLUTTER_CEX100_LIBGDL_PREFIX=CE4100/
364 AC_SUBST(CLUTTER_CEX100_LIBGDL_PREFIX)
366 AS_IF([test "x$have_gdl" = "xno"], [AC_MSG_ERROR([libgdl.h not found])])
368 FLAVOUR_LIBS="$FLAVOUR_LIBS -lgdl"
370 SUPPORT_EGL_PLATFORM_GDL=1
372 AC_DEFINE([CLUTTER_EGL_BACKEND_CEX100], [1], [Use CEX100 EGL backend])
376 FLAVOUR_LIBS="$FLAVOUR_LIBS $TSLIB_LIBS $EVDEV_LIBS"
377 FLAVOUR_CFLAGS="$FLAVOUR_CFLAGS $TSLIB_CFLAGS $EVDEV_CFLAGS"
379 AC_DEFINE([CLUTTER_EGL_BACKEND_GENERIC], [1], [Use Generic EGL backend])
381 AC_DEFINE([HAVE_CLUTTER_EGL], [1], [Have the EGL backend])
384 AS_IF([test "x$enable_osx" = "xyes"],
386 CLUTTER_BACKENDS="$CLUTTER_BACKENDS osx"
388 AC_DEFINE([HAVE_CLUTTER_OSX], [1], [Have the OSX backend])
390 FLAVOUR_LIBS="$FLAVOUR_LIBS -framework Cocoa -framework OpenGL"
395 AS_IF([test "x$enable_win32" = "xyes"],
397 CLUTTER_BACKENDS="$CLUTTER_BACKENDS win32"
399 AC_DEFINE([HAVE_CLUTTER_WIN32], [1], [Have the Win32 backend])
401 FLAVOUR_LIBS="$FLAVOUR_LIBS -lopengl32 -lgdi32 -lwinmm"
402 FLAVOUR_CFLAGS="$FLAVOUR_CFLAGS -D_WIN32_WINNT=0x0500"
404 AC_CHECK_TOOL(WINDRES, [windres], [AC_MSG_ERROR([*** windres is required])])
409 AS_IF([test "x$CLUTTER_BACKENDS" = "x"],
411 AC_MSG_ERROR([No backend enabled. You need to enable at least one backend.])
414 # conditionals for use in automake files...
415 AM_CONDITIONAL(SUPPORT_GLX, [test "x$SUPPORT_GLX" = "x1"])
416 AM_CONDITIONAL(SUPPORT_X11, [test "x$SUPPORT_X11" = "x1"])
417 AM_CONDITIONAL(SUPPORT_GDK, [test "x$SUPPORT_GDK" = "x1"])
418 AM_CONDITIONAL(SUPPORT_EGL, [test "x$SUPPORT_EGL" = "x1"])
419 AM_CONDITIONAL(SUPPORT_OSX, [test "x$SUPPORT_OSX" = "x1"])
420 AM_CONDITIONAL(SUPPORT_WIN32, [test "x$SUPPORT_WIN32" = "x1"])
421 AM_CONDITIONAL(SUPPORT_CEX100, [test "x$SUPPORT_EGL_PLATFORM_GDL" = "x1"])
422 AM_CONDITIONAL(SUPPORT_WAYLAND, [test "x$SUPPORT_WAYLAND" = "x1"])
423 AM_CONDITIONAL(SUPPORT_STUB, [test "x$SUPPORT_WIN32" = "x1" -o \
424 "x$SUPPORT_OSX" = "x1" -o \
425 "x$SUPPORT_WAYLAND" = "x1"])
427 AM_CONDITIONAL(USE_COGL, [test "x$SUPPORT_COGL" = "x1"])
428 AM_CONDITIONAL(USE_TSLIB, [test "x$have_tslib" = "xyes"])
429 AM_CONDITIONAL(USE_EVDEV, [test "x$have_evdev" = "xyes"])
430 AM_CONDITIONAL(USE_GLD, [test "x$have_gdl" = "xyes"])
432 dnl Instead of using AM_CFLAGS to ensure
433 dnl COGL_ENABLE_EXPERIMENTAL_2_0_API is defined while compiling clutter
434 dnl and cogl code we use a define in config.h instead. This helps ensure
435 dnl other tools such as glib-mkenums and gir-scanner don't end up
436 dnl using the define also.
437 AC_DEFINE([COGL_ENABLE_EXPERIMENTAL_2_0_API], [1], [Can use Cogl 2.0 API internally])
439 dnl strip leading spaces
440 CLUTTER_BACKENDS=${CLUTTER_BACKENDS#* }
441 AC_SUBST(CLUTTER_BACKENDS)
443 dnl === Clutter configuration =================================================
445 CLUTTER_CONFIG_DEFINES=
448 AS_IF([test "x$SUPPORT_X11" = "x1"],
449 [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
450 #define CLUTTER_WINDOWING_X11 1"])
451 AS_IF([test "x$SUPPORT_GDK" = "x1"],
452 [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
453 #define CLUTTER_WINDOWING_GDK 1"])
454 AS_IF([test "x$SUPPORT_GLX" = "x1"],
455 [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
456 #define CLUTTER_WINDOWING_GLX 1"])
457 AS_IF([test "x$SUPPORT_EGL" = "x1"],
458 [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
459 #define CLUTTER_WINDOWING_EGL 1"])
460 AS_IF([test "x$SUPPORT_WAYLAND" = "x1"],
461 [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
462 #define CLUTTER_WINDOWING_WAYLAND 1"])
463 AS_IF([test "x$SUPPORT_OSX" = "x1"],
464 [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
465 #define CLUTTER_WINDOWING_OSX 1"])
466 AS_IF([test "x$SUPPORT_WIN32" = "x1"],
467 [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
468 #define CLUTTER_WINDOWING_WIN32 1"])
469 AS_IF([test "x$SUPPORT_EGL_PLATFORM_GDL" = "x1"],
470 [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
471 #define CLUTTER_WINDOWING_CEX100 1"])
472 AS_IF([test "x$SUPPORT_EVDEV" = "x1"],
473 [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
474 #define CLUTTER_WINDOWING_EVDEV 1"])
475 AS_IF([test "x$SUPPORT_TSLIB" = "x1"],
476 [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
477 #define CLUTTER_WINDOWING_TSLIB 1"])
479 AC_SUBST([CLUTTER_CONFIG_DEFINES])
481 dnl === Clutter substitutions kept for backwards compatibility ================
482 AC_SUBST([CLUTTER_WINSYS], [deprecated])
483 AC_SUBST([CLUTTER_WINSYS_BASE], [deprecated])
484 AC_SUBST([CLUTTER_STAGE_TYPE], [deprecated])
485 AC_SUBST([CLUTTER_SONAME_INFIX], [deprecated])
486 AC_SUBST([CLUTTER_FLAVOUR], [deprecated])
487 AC_SUBST([CLUTTER_COGL], [deprecated])
488 AC_SUBST([COGL_DRIVER], [deprecated])
490 dnl === Image loading backend =================================================
493 dnl === X11 checks, only for X11-based backends ===============================
497 AS_IF([test "x$SUPPORT_X11" = "x1"],
499 # base X11 includes and libraries
500 AC_MSG_CHECKING([for X11])
502 # start with pkg-config
503 PKG_CHECK_EXISTS([x11], [have_x11=yes], [have_x11=no])
504 AS_IF([test "x$have_x11" = "xyes"],
508 # we actually need to ask for CFLAGS and LIBS
509 X11_CFLAGS=`$PKG_CONFIG --cflags $X11_PC_FILES`
510 X11_LIBS=`$PKG_CONFIG --libs $X11_PC_FILES`
512 AC_MSG_RESULT([found])
515 # no pkg-config, let's go old school
518 AS_IF([test "x$no_x" = "xyes"],
519 [AC_MSG_ERROR([No X11 Libraries found])],
521 AS_IF([test "x$x_includes" != "xNONE" && test -n "$x_includes"],
522 [X11_CFLAGS=-I`echo $x_includes | sed -e "s/:/ -I/g"`])
524 AS_IF([test "x$x_libraries" != "xNONE" && test -n "$x_libraries"],
525 [X11_LIBS=-L`echo $x_libraries | sed -e "s/:/ -L/g"`])
527 AC_MSG_RESULT([found])
534 AC_MSG_CHECKING([for XEXT extension])
535 PKG_CHECK_EXISTS([xext], [have_xext=yes], [have_xext=no])
536 AS_IF([test "x$have_xext" = "xyes"],
538 AC_DEFINE(HAVE_XEXT, [1], [Define to 1 if we have the XEXT X extension])
540 X11_LIBS="$X11_LIBS -lXext"
541 X11_PC_FILES="$X11_PC_FILES xext"
543 AC_MSG_RESULT([found])
545 [AC_MSG_ERROR([Not found])]
549 AC_MSG_CHECKING([for XFIXES extension >= $XFIXES_REQ_VERSION])
550 PKG_CHECK_EXISTS([xfixes >= $XFIXES_REQ_VERSION], [have_xfixes=yes], [have_xfixes=no])
551 AS_IF([test "x$have_xfixes" = "xyes"],
553 AC_DEFINE(HAVE_XFIXES, [1], [Define to 1 if we have the XFIXES X extension])
555 X11_LIBS="$X11_LIBS -lXfixes"
556 X11_PC_FILES="$X11_PC_FILES xfixes >= $XFIXES_REQ_VERSION"
558 AC_MSG_RESULT([found])
560 [AC_MSG_ERROR([Not found])]
564 AC_MSG_CHECKING([for XDAMAGE extension])
565 PKG_CHECK_EXISTS([xdamage], [have_xdamage=yes], [have_xdamage=no])
566 AS_IF([test "x$have_xdamage" = "xyes"],
568 AC_DEFINE(HAVE_XDAMAGE, [1], [Define to 1 if we have the XDAMAGE X extension])
570 X11_LIBS="$X11_LIBS -lXdamage"
571 X11_PC_FILES="$X11_PC_FILES xdamage"
573 AC_MSG_RESULT([found])
575 [AC_MSG_ERROR([not found])]
578 # XCOMPOSITE (optional)
579 AC_MSG_CHECKING([for XCOMPOSITE extension >= $XCOMPOSITE_REQ_VERSION])
580 PKG_CHECK_EXISTS([xcomposite >= $XCOMPOSITE_REQ_VERSION], [have_xcomposite=yes], [have_xcomposite=no])
581 AS_IF([test "x$have_xcomposite" = "xyes"],
583 AC_DEFINE(HAVE_XCOMPOSITE, [1], [Define to 1 if we have the XCOMPOSITE X extension])
585 X11_LIBS="$X11_LIBS -lXcomposite"
586 X11_PC_FILES="$X11_PC_FILES xcomposite >= $XCOMPOSITE_REQ_VERSION"
588 AC_MSG_RESULT([found])
590 [AC_MSG_ERROR([not found])]
593 # X Generic Extensions (optional)
594 clutter_save_CPPFLAGS="$CPPFLAGS"
595 CPPFLAGS="$CPPFLAGS $X11_CFLAGS"
597 clutter_save_LIBS="$LIBS"
598 LIBS="$LIBS $X11_LIBS"
601 AC_CHECK_FUNC([XGetEventData],
603 AC_DEFINE([HAVE_XGE], [1], [Define to 1 if X Generic Extensions is available])
607 CPPFLAGS="$clutter_save_CPPFLAGS"
608 LIBS="$clutter_save_LIBS"
611 AC_ARG_ENABLE([xinput],
612 [AS_HELP_STRING([--enable-xinput], [Use the XI X extension])],
616 AS_IF([test "x$enable_xinput" = "xyes"],
618 PKG_CHECK_EXISTS([xi], [have_xinput=yes], [have_xinput=no])
624 AS_CASE([$have_xinput],
628 AC_CHECK_HEADERS([X11/extensions/XInput2.h],
631 AC_DEFINE([HAVE_XINPUT_2],
633 [Define to 1 if XI2 is available])
637 AC_DEFINE([HAVE_XINPUT],
639 [Define to 1 if XInput is available])
642 X11_LIBS="$X11_LIBS $XINPUT_LIBS"
643 X11_PC_FILES="$X11_PC_FILES xi"
650 [AC_MSG_ERROR([Invalid argument for --enable-xinput])]
654 clutter_save_CPPFLAGS="$CPPFLAGS"
655 CPPFLAGS="$CPPFLAGS $X11_CFLAGS"
657 clutter_save_LIBS="$LIBS"
658 LIBS="$LIBS $X11_LIBS"
661 AC_CHECK_FUNC([XkbQueryExtension],
663 AC_DEFINE(HAVE_XKB, 1, [Define to use XKB extension])
667 CPPFLAGS="$clutter_save_CPPFLAGS"
668 LIBS="$clutter_save_LIBS"
671 BACKEND_PC_FILES="$BACKEND_PC_FILES $X11_PC_FILES"
672 FLAVOUR_LIBS="$FLAVOUR_LIBS $X11_LIBS"
673 FLAVOUR_CFLAGS="$FLAVOUR_CFLAGS $X11_CFLAGS"
677 AM_CONDITIONAL([BUILD_XI2], [test "x$have_xinput2" = "xyes"])
678 AM_CONDITIONAL([X11_TESTS], [test "x$x11_tests" = "xyes"])
680 dnl === Enable debug level ====================================================
682 m4_define([debug_default], [m4_if(m4_eval(clutter_minor_version % 2), [1], [yes], [minimum])])
683 AC_ARG_ENABLE([debug],
684 [AS_HELP_STRING([--enable-debug=@<:@no/minimum/yes@:>@],
685 [Control Clutter debugging level @<:@default=]debug_default[@:>@])],
687 [enable_debug=debug_default])
689 AS_CASE([$enable_debug],
693 test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
694 CLUTTER_DEBUG_CFLAGS="-DCLUTTER_ENABLE_DEBUG"
698 [CLUTTER_DEBUG_CFLAGS="-DCLUTTER_ENABLE_DEBUG -DG_DISABLE_CAST_CHECKS"],
701 [CLUTTER_DEBUG_CFLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"],
703 [AC_MSG_ERROR([Unknown argument for --enable-debug])]
706 AC_SUBST(CLUTTER_DEBUG_CFLAGS)
708 dnl === Enable deprecation guards ==================================================
710 m4_define([deprecated_default],
711 [m4_if(m4_eval(clutter_minor_version % 2),
716 AC_ARG_ENABLE([deprecated],
717 [AS_HELP_STRING([--enable-deprecated=@<:@no/yes@:>@],
718 [Whether deprecated symbols should be disabled when compiling Clutter @<:@default=]deprecated_default[@:>@])],
720 [enable_deprecated=deprecated_default])
722 AS_CASE([$enable_deprecated],
726 CLUTTER_DEPRECATED_CFLAGS="-DG_DISABLE_SINGLE_INCLUDES -DCOGL_DISABLE_DEPRECATED -DCLUTTER_DISABLE_DEPRECATED"
731 CLUTTER_DEPRECATED_CFLAGS="-DGLIB_DISABLE_DEPRECATION_WARNINGS -DCLUTTER_DISABLE_DEPRECATION_WARNINGS"
734 [AC_MSG_ERROR([Unknown argument for --enable-deprecated])]
737 AC_SUBST([CLUTTER_DEPRECATED_CFLAGS])
740 dnl === Conformance test suite ================================================
742 AC_ARG_ENABLE([conformance],
743 [AS_HELP_STRING([--enable-conformance=@<:@no/yes@:>@],
744 [Build conformance test suite @<:@default=yes@:>@])],
746 [enable_conformance=yes])
748 AM_CONDITIONAL([BUILD_TESTS], [test "x$enable_conformance" = "xyes"])
750 dnl === Profiling =============================================================
752 m4_define([profile_default], [no])
753 AC_ARG_ENABLE(profile,
754 AS_HELP_STRING([--enable-profile=@<:@no/yes@:>@],
755 [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@:>@]),
757 [enable_profile=profile_default])
759 AS_CASE([$enable_profile],
763 AS_IF([test "x$GCC" = "xyes"],
765 PKG_CHECK_MODULES([PROFILE_DEP], [uprof-0.3])
766 CLUTTER_PROFILE_CFLAGS="-DCLUTTER_ENABLE_PROFILE $PROFILE_DEP_CFLAGS"
767 CLUTTER_PROFILE_LDFLAGS="$PROFILE_DEP_LIBS"
769 AS_IF([test "x$enable_debug" = "xyes"], [CLUTTER_PROFILE_CFLAGS+=" -DUPROF_DEBUG"])
772 AC_MSG_ERROR([--enable-profile is currently only supported if using GCC])
778 CLUTTER_PROFILE_CFLAGS=""
779 CLUTTER_PROFILE_LDFLAGS=""
782 [*], [AC_MSG_ERROR([Invalid value for --enable-profile])]
784 AM_CONDITIONAL(PROFILE, test "x$enable_profile" != "xno")
785 AC_SUBST(CLUTTER_PROFILE_CFLAGS)
786 AC_SUBST(CLUTTER_PROFILE_LDFLAGS)
788 dnl === Coverage report =======================================================
790 AC_PATH_PROG([GCOV], [gcov], [enable_gcov=no])
792 AC_MSG_CHECKING([whether to build with gcov testing])
794 AC_ARG_ENABLE([gcov],
795 [AS_HELP_STRING([--enable-gcov],
796 [Whether to enable coverage testing (requires gcc
801 AS_IF([test "x$enable_gcov" = "xyes" && test "x$GCC" = "xyes"],
803 AS_IF([test "x$enable_conformance" = "xno"],
804 [AC_MSG_WARN([Conformance test suite is disabled, the coverage report will be incomplete])],
805 [AC_MSG_RESULT([yes])]
808 GCOV_CFLAGS="-g -O0 -fprofile-arcs -ftest-coverage"
809 GCOV_LDFLAGS="-lgcov"
811 [AC_MSG_RESULT([no])]
814 AM_CONDITIONAL([GCOV_ENABLED], [test "x$enable_gcov" = "xyes"])
815 AC_SUBST([GCOV_CFLAGS])
816 AC_SUBST([GCOV_LDFLAGS])
818 dnl === Enable strict compiler flags ==========================================
820 # use strict compiler flags only when building from git; the rules for
821 # distcheck will take care of turning this on when making a release
822 m4_define([maintainer_flags_default], [m4_if(m4_eval(clutter_micro_version % 2), [1], [yes], [no])])
823 AC_ARG_ENABLE([maintainer-flags],
824 [AS_HELP_STRING([--enable-maintainer-flags=@<:@no/yes/error@:>@],
825 [Use strict compiler flags @<:@default=]maintainer_flags_default[@:>@])],
827 [enable_maintainer_flags=maintainer_flags_default])
829 MAINTAINER_COMPILER_FLAGS="-Wall -Wshadow -Wcast-align -Wuninitialized
830 -Wno-strict-aliasing -Wempty-body -Wformat
831 -Wformat-security -Winit-self
832 -Wdeclaration-after-statement -Wvla
835 AS_CASE([$enable_maintainer_flags],
838 AS_COMPILER_FLAGS([MAINTAINER_CFLAGS], [$MAINTAINER_COMPILER_FLAGS])
847 MAINTAINER_COMPILER_FLAGS="$MAINTAINER_COMPILER_FLAGS -Werror"
848 AS_COMPILER_FLAGS([MAINTAINER_CFLAGS], [$MAINTAINER_COMPILER_FLAGS])
852 [AC_MSG_ERROR([Invalid option for --enable-maintainer-flags])]
855 # strip leading spaces
856 MAINTAINER_CFLAGS=${MAINTAINER_CFLAGS#* }
857 AC_SUBST(MAINTAINER_CFLAGS)
859 dnl === Dependencies, compiler flags and linker libraries =====================
860 # strip leading space
861 BACKEND_PC_FILES=${BACKEND_PC_FILES#* }
863 CLUTTER_REQUIRES="$CLUTTER_BASE_PC_FILES $IMAGE_PC_FILES $BACKEND_PC_FILES"
864 PKG_CHECK_MODULES(CLUTTER_DEPS, [$CLUTTER_REQUIRES])
865 AC_SUBST(CLUTTER_REQUIRES)
867 CLUTTER_CFLAGS="$FLAVOUR_CFLAGS $CLUTTER_DEPS_CFLAGS $CLUTTER_PROFILE_CFLAGS $GLIB_CFLAGS"
868 CLUTTER_LIBS="$FLAVOUR_LIBS $CLUTTER_DEPS_LIBS $CLUTTER_PROFILE_LDFLAGS $GLIB_LIBS"
869 AC_SUBST(CLUTTER_CFLAGS)
870 AC_SUBST(CLUTTER_LIBS)
873 dnl === GObject-Introspection check ===========================================
875 GOBJECT_INTROSPECTION_CHECK([gi_req_version])
877 dnl === GTK Doc check =========================================================
879 GTK_DOC_CHECK([gtk_doc_req_version], [--flavour no-tmpl])
881 # we don't want to build the documentation from a Git clone unless we
882 # explicitly tell configure to do so; this allows avoiding to recurse into
883 # the documentation directory when building Clutter inside Poky for a
884 # target device that doesn't have gtk-doc installed. for reference
885 # see: http://bugzilla.openedhand.com/show_bug.cgi?id=1047
887 # we use autogen.sh as it exists only inside the Git clones, and it
888 # is not packaged into tarballs.
889 AM_CONDITIONAL([BUILD_GTK_DOC], [test "x$enable_gtk_doc" = "xyes" || test ! -f "autogen.sh"])
891 # prefixes for fixing gtk-doc references
892 CAIRO_PREFIX="`$PKG_CONFIG --variable=prefix cairo`"
893 GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
894 PANGO_PREFIX="`$PKG_CONFIG --variable=prefix pango`"
895 COGL_PREFIX="`$PKG_CONFIG --variable=prefix cogl-1.0`"
896 ATK_PREFIX="`$PKG_CONFIG --variable=prefix atk`"
897 AC_SUBST(CAIRO_PREFIX)
898 AC_SUBST(GLIB_PREFIX)
899 AC_SUBST(PANGO_PREFIX)
900 AC_SUBST(COGL_PREFIX)
903 dnl === Manual ================================================================
905 AC_ARG_ENABLE([docs],
906 [AS_HELP_STRING([--enable-docs=@<:@no/yes@:>@],
907 [Build optional documentation; requires xsltproc and jw.])],
908 [enable_docs=$enableval],
912 AS_IF([test "x$enable_docs" = "xyes"],
914 AC_PATH_PROG(JW, [jw], [no])
915 AS_IF([test "x$JW" = "xno"],
917 AC_MSG_WARN([jw not found; pdf generation has been disabled])
921 AC_PATH_PROG(XSLTPROC, [xsltproc], [no])
922 AS_IF([test "x$XSLTPROC" = "xno"],
924 AC_MSG_ERROR([xsltproc not found])
929 AM_CONDITIONAL(ENABLE_DOCS, [test "x$enable_docs" = "xyes"])
930 AM_CONDITIONAL(ENABLE_PDFS, [test "x$enable_pdfs" = "xyes"])
932 dnl === I18N ==================================================================
934 AM_GNU_GETTEXT_VERSION([0.17])
935 AM_GNU_GETTEXT([external])
937 GETTEXT_PACKAGE="clutter-1.0"
938 AC_SUBST(GETTEXT_PACKAGE)
939 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],
940 ["$GETTEXT_PACKAGE"],
941 [The prefix for our gettext translation domains.])
944 dnl ===========================================================================
952 build/autotools/Makefile
956 clutter/clutter-config.h
957 clutter/clutter-version.h
958 clutter/clutter-$CLUTTER_API_VERSION.pc:clutter/clutter.pc.in
960 clutter/cally/cally-$CLUTTER_API_VERSION.pc:clutter/cally/cally.pc.in
962 clutter/egl/clutter-cex100.h
965 tests/accessibility/Makefile
966 tests/conform/Makefile
967 tests/conform/test-launcher.sh
969 tests/interactive/Makefile
970 tests/interactive/wrapper.sh
971 tests/micro-bench/Makefile
972 tests/performance/Makefile
975 doc/reference/Makefile
976 doc/reference/clutter/Makefile
977 doc/reference/clutter/clutter-docs.xml
978 doc/reference/cally/Makefile
979 doc/reference/cally/cally-docs.xml
981 doc/cookbook/Makefile
982 doc/cookbook/clutter-cookbook.xml
983 doc/cookbook/examples/Makefile
990 dnl === Summary ===============================================================
993 echo "Clutter - $VERSION (${CLUTTER_RELEASE_STATUS})"
998 echo " Prefix: ${prefix}"
999 echo " Libdir: ${libdir}"
1000 echo " Sysconfdir: ${sysconfdir}"
1002 # Compiler/Debug related flags
1004 echo " • Compiler options:"
1005 echo " Clutter debug level: ${enable_debug}"
1006 echo " Compiler flags: ${CFLAGS} ${MAINTAINER_CFLAGS}"
1007 echo " Profiling enabled: ${enable_profile}"
1008 echo " Enable coverage tests: ${enable_gcov}"
1009 echo " Enable deprecated symbols: ${enable_deprecated}"
1013 echo " • Documentation:"
1014 echo " Build API Reference: ${enable_gtk_doc}"
1015 echo " Build Additional Documentation: ${enable_docs} (Generate PDF: ${enable_pdfs})"
1020 echo " Build introspection data: ${enable_introspection}"
1021 echo " Build conformance test suite: ${enable_conformance}"
1022 echo " Build X11-specific tests: ${x11_tests}"
1024 # Clutter backend related flags
1026 echo " • Clutter Backends:"
1028 if test "x$experimental_backend" = "xno"; then
1029 echo " Windowing systems: ${CLUTTER_BACKENDS}"
1031 echo " Windowing systems: ${CLUTTER_BACKENDS} (WARNING: Experimental backends enabled)"
1034 if test "x$SUPPORT_X11" = "x1"; then
1036 echo " Enable XComposite: ${have_xcomposite}"
1037 echo " Enable XInput: ${have_xinput}"
1038 echo " Enable Xge: ${have_xge}"
1039 echo " Enable XI2: ${have_xinput2}"
1040 echo " Enable XKB: ${have_xkb}"
1043 if test "x$SUPPORT_EGL" = "x1"; then
1045 echo " Enable TSLib: ${have_tslib}"
1046 echo " Enable evdev: ${have_evdev}"
1047 echo " Enable GDL: ${have_gdl}"
1052 # General warning about experimental features
1053 if test "x$experimental_backend" = "xyes"; then
1055 echo "☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠"
1058 echo " The stability of your build might be affected by one or more"
1059 echo " experimental backends or experimental and unsupported features"
1060 echo "☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠"