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])
86 dnl = Preliminary platform checks =============================================
94 AC_MSG_CHECKING([if building for some Win32 platform])
96 [*-*-mingw*|*-*-cygwin*],
98 CLUTTER_LT_LDFLAGS="$CLUTTER_LT_LDFLAGS -no-undefined"
104 AC_MSG_RESULT([$platform_win32])
106 AM_CONDITIONAL(OS_WIN32, [test "$platform_win32" = "yes"])
108 AC_CHECK_HEADER([OpenGL/gl.h], [platform_quartz=yes], [platform_quartz=no])
109 AM_CONDITIONAL(OS_QUARTZ, [test "$platform_quartz" = "yes"])
111 AC_CHECK_HEADER([GL/glx.h], [platform_glx=yes], [platform_glx=no])
112 AC_CHECK_LIB([GL], [glXCreateContext], [platform_glx=yes], [platform_glx=no])
113 AM_CONDITIONAL(OS_GLX, [test "$platform_glx" = "yes"])
115 AC_SUBST(CLUTTER_LT_LDFLAGS)
119 dnl = Dependencies =========================================================
121 # Checks for programs.
124 # require libtool >= 2.2
126 LT_INIT([disable-static])
128 # Checks for header files.
131 # required versions for dependencies
132 m4_define([glib_req_version], [2.31.0])
133 m4_define([cogl_req_version], [1.9.1])
134 m4_define([json_glib_req_version], [0.12.0])
135 m4_define([atk_req_version], [2.1.5])
136 m4_define([cairo_req_version], [1.10])
137 m4_define([pango_req_version], [1.20])
138 m4_define([gi_req_version], [0.9.5])
139 m4_define([uprof_req_version], [0.3])
140 m4_define([gtk_doc_req_version], [1.15])
141 m4_define([xfixes_req_version], [3])
142 m4_define([xcomposite_req_version], [0.4])
143 m4_define([gdk_req_version], [3.0.0])
145 AC_SUBST([GLIB_REQ_VERSION], [glib_req_version])
146 AC_SUBST([COGL_REQ_VERSION], [cogl_req_version])
147 AC_SUBST([JSON_GLIB_REQ_VERSION], [json_glib_req_version])
148 AC_SUBST([ATK_REQ_VERSION], [atk_req_version])
149 AC_SUBST([CAIRO_REQ_VERSION], [cairo_req_version])
150 AC_SUBST([PANGO_REQ_VERSION], [pango_req_version])
151 AC_SUBST([GI_REQ_VERSION], [gi_req_version])
152 AC_SUBST([UPROF_REQ_VERSION], [uprof_req_version])
153 AC_SUBST([GTK_DOC_REQ_VERSION], [gtk_doc_req_version])
154 AC_SUBST([XFIXES_REQ_VERSION], [xfixes_req_version])
155 AC_SUBST([XCOMPOSITE_REQ_VERSION], [xcomposite_req_version])
156 AC_SUBST([GDK_REQ_VERSION], [gdk_req_version])
158 # Checks for typedefs, structures, and compiler characteristics.
159 AM_PATH_GLIB_2_0([glib_req_version],
161 [AC_MSG_ERROR([glib-2.0 is required])],
162 [gobject gthread gmodule-no-export])
164 # Check for -Bsymbolic-functions to avoid intra-library PLT jumps
165 AC_ARG_ENABLE([Bsymbolic],
166 [AS_HELP_STRING([--disable-Bsymbolic],
167 [Avoid linking with -Bsymbolic])],
170 saved_LDFLAGS="${LDFLAGS}"
171 AC_MSG_CHECKING([for -Bsymbolic-functions linker flag])
172 LDFLAGS=-Wl,-Bsymbolic-functions
173 AC_TRY_LINK([], [int main (void) { return 0; }],
182 LDFLAGS="${saved_LDFLAGS}"
185 AS_IF([test "x$enable_Bsymbolic" = "xyes"], [CLUTTER_LINK_FLAGS=-Wl[,]-Bsymbolic-functions])
186 AC_SUBST(CLUTTER_LINK_FLAGS)
190 dnl ========================================================================
196 experimental_backend=no
198 # base dependencies for core
199 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"
201 # backend specific pkg-config files
204 dnl === Clutter windowing system backend ======================================
206 AC_ARG_ENABLE([x11-backend],
207 [AS_HELP_STRING([--enable-x11-backend=@<:@yes/no@:>@], [Enable the X11 backend (default=check)])],
208 [enable_x11=$enableval],
210 AC_ARG_ENABLE([win32-backend],
211 [AS_HELP_STRING([--enable-win32-backend=@<:@yes/no@:>@], [Enable the Windows backend (default=check)])],
212 [enable_win32=$enableval],
213 [enable_win32=check])
214 AC_ARG_ENABLE([quartz-backend],
215 [AS_HELP_STRING([--enable-quartz-backend=@<:@yes/no@:>@], [Enable the OS X backend (default=check)])],
216 [enable_osx=$enableval],
218 AC_ARG_ENABLE([gdk-backend],
219 [AS_HELP_STRING([--enable-gdk-backend=@<:@yes/no@:>@], [Enable the GDK backend (default=check)])],
220 [enable_gdk=$enableval],
222 AC_ARG_ENABLE([wayland-backend],
223 [AS_HELP_STRING([--enable-wayland-backend=@<:@yes/no@:>@], [Enable the Wayland client backend (default=no)])],
224 [enable_wayland=$enableval],
226 AC_ARG_ENABLE([egl-backend],
227 [AS_HELP_STRING([--enable-egl-backend=@<:@yes/no@:>@], [Enable the EGL framebuffer backend (default=no)])],
228 [enable_egl=$enableval],
231 dnl Define default values
232 AS_IF([test "x$enable_x11" = "xcheck"],
234 AS_IF([test "x$platform_glx" = "xyes"], [enable_x11=yes], [enable_x11=no])
237 AS_IF([test "x$enable_win32" = "xcheck"],
239 AS_IF([test "x$platform_win32" = "xyes"], [enable_win32=yes], [enable_win32=no])
242 AS_IF([test "x$enable_osx" = "xcheck"],
244 AS_IF([test "x$platform_quartz" = "xyes"], [enable_osx=yes], [enable_osx=no])
247 AS_IF([test "x$enable_gdk" = "xcheck"],
249 PKG_CHECK_EXISTS([gdk-3.0 >= gdk_req_version], [enable_gdk=yes], [enable_gdk=no])
252 dnl Per-backend rules
253 AS_IF([test "x$enable_x11" = "xyes"],
255 CLUTTER_BACKENDS="$CLUTTER_BACKENDS x11"
261 # Mesa 7.3 added a GL pkg-config file, finally, but if a pkg-config
262 # file isn't found just add -lGL and hope for the best.
263 PKG_CHECK_EXISTS([gl],
264 [BACKEND_PC_FILES="$BACKEND_PC_FILES gl"],
265 [FLAVOUR_LIBS="$FLAVOUR_LIBS -lGL"])
267 # We might fall back to DRM for sync-to-vblank on GLX
268 PKG_CHECK_EXISTS([libdrm],
270 AC_DEFINE([HAVE_DRM], [1], [Have libdrm support])
271 BACKEND_PC_FILES="$BACKEND_PC_FILES libdrm"
275 # we use fontconfig API and pango-fc when the fontconfig
276 # configuration changes
277 PKG_CHECK_EXISTS([pangoft2],
279 AC_DEFINE([HAVE_PANGO_FT2], [1], [Supports PangoFt2])
280 BACKEND_PC_FILES="$BACKEND_PC_FILES pangoft2"
284 AC_DEFINE([HAVE_CLUTTER_GLX], [1], [Have the GLX backend])
287 AS_IF([test "x$enable_gdk" = "xyes"],
289 CLUTTER_BACKENDS="$CLUTTER_BACKENDS gdk"
294 BACKEND_PC_FILES="$BACKEND_PC_FILES gdk-3.0"
295 PKG_CHECK_EXISTS([gl], [BACKEND_PC_FILES="$BACKEND_PC_FILES gl"], [])
298 AS_IF([test "x$enable_wayland" = "xyes"],
300 CLUTTER_BACKENDS="$CLUTTER_BACKENDS wayland"
302 experimental_backend="yes"
307 PKG_CHECK_EXISTS([gl], [BACKEND_PC_FILES="$BACKEND_PC_FILES gl"], [])
308 PKG_CHECK_EXISTS([egl], [BACKEND_PC_FILES="$BACKEND_PC_FILES egl"], [])
309 PKG_CHECK_EXISTS([wayland-client xkbcommon],
310 [BACKEND_PC_FILES="$BACKEND_PC_FILES wayland-client xkbcommon"],
313 AC_DEFINE([HAVE_CLUTTER_WAYLAND], [1], [Have the Wayland backend])
316 AS_IF([test "x$enable_egl" = "xyes"],
318 CLUTTER_BACKENDS="$CLUTTER_BACKENDS egl"
323 # if Mesa has support for egl, we can use it as well
324 PKG_CHECK_EXISTS([egl],
326 BACKEND_PC_FILES="$BACKEND_PC_FILES egl"
331 [AS_HELP_STRING([--with-tslib=@<:@yes/no@:>@], [Use TSLib for events (default=no)])],
336 [AS_HELP_STRING([--with-evdev=@<:@yes/no@:>@], [Use evdev for events (default=yes)])],
341 [AS_HELP_STRING([--with-gdl=@<:@yes/no@:>@], [Use libgdl for CE3100/CE4100 support (default=no)])],
345 AS_IF([test "x$with_tslib" = "xyes"],
347 PKG_CHECK_MODULES(TSLIB, [tslib-1.0], [have_tslib=yes], [have_tslib=no])
348 AS_IF([test "x$have_tslib" = "xyes"],
350 AC_DEFINE([HAVE_TSLIB], [1], [Have tslib for touchscreen handling])
356 AS_IF([test "x$with_evdev" = "xyes"],
358 PKG_CHECK_MODULES(EVDEV, [gudev-1.0 xkbcommon], [have_evdev=yes], [have_evdev=no])
359 AS_IF([test "x$have_evdev" = "xyes"],
361 AC_DEFINE([HAVE_EVDEV], [1], [Have evdev support for input handling])
367 AS_IF([test "x$with_gdl" = "xyes"],
371 AC_CHECK_HEADERS([libgdl.h], [have_gdl=yes])
373 AS_IF([test "x$have_gdl" = "xno"],
375 AC_CHECK_HEADERS([CE4100/libgdl.h],
377 FLAVOUR_CFLAGS="-I/usr/include/CE4100"
379 CLUTTER_CEX100_LIBGDL_PREFIX=CE4100/
383 AC_SUBST(CLUTTER_CEX100_LIBGDL_PREFIX)
385 AS_IF([test "x$have_gdl" = "xno"], [AC_MSG_ERROR([libgdl.h not found])])
387 FLAVOUR_LIBS="$FLAVOUR_LIBS -lgdl"
389 SUPPORT_EGL_PLATFORM_GDL=1
391 AC_DEFINE([CLUTTER_EGL_BACKEND_CEX100], [1], [Use CEX100 EGL backend])
395 FLAVOUR_LIBS="$FLAVOUR_LIBS $TSLIB_LIBS $EVDEV_LIBS"
396 FLAVOUR_CFLAGS="$FLAVOUR_CFLAGS $TSLIB_CFLAGS $EVDEV_CFLAGS"
398 AC_DEFINE([CLUTTER_EGL_BACKEND_GENERIC], [1], [Use Generic EGL backend])
400 AC_DEFINE([HAVE_CLUTTER_EGL], [1], [Have the EGL backend])
403 AS_IF([test "x$enable_osx" = "xyes"],
405 CLUTTER_BACKENDS="$CLUTTER_BACKENDS osx"
407 AC_DEFINE([HAVE_CLUTTER_OSX], [1], [Have the OSX backend])
409 FLAVOUR_LIBS="$FLAVOUR_LIBS -framework Cocoa -framework OpenGL"
414 AS_IF([test "x$enable_win32" = "xyes"],
416 CLUTTER_BACKENDS="$CLUTTER_BACKENDS win32"
418 AC_DEFINE([HAVE_CLUTTER_WIN32], [1], [Have the Win32 backend])
420 FLAVOUR_LIBS="$FLAVOUR_LIBS -lopengl32 -lgdi32 -lwinmm"
421 FLAVOUR_CFLAGS="$FLAVOUR_CFLAGS -D_WIN32_WINNT=0x0500"
423 AC_CHECK_TOOL(WINDRES, [windres], [AC_MSG_ERROR([*** windres is required])])
428 AS_IF([test "x$CLUTTER_BACKENDS" = "x"],
430 AC_MSG_ERROR([No backend enabled. You need to enable at least one backend.])
433 # conditionals for use in automake files...
434 AM_CONDITIONAL(SUPPORT_GLX, [test "x$SUPPORT_GLX" = "x1"])
435 AM_CONDITIONAL(SUPPORT_X11, [test "x$SUPPORT_X11" = "x1"])
436 AM_CONDITIONAL(SUPPORT_GDK, [test "x$SUPPORT_GDK" = "x1"])
437 AM_CONDITIONAL(SUPPORT_EGL, [test "x$SUPPORT_EGL" = "x1"])
438 AM_CONDITIONAL(SUPPORT_OSX, [test "x$SUPPORT_OSX" = "x1"])
439 AM_CONDITIONAL(SUPPORT_WIN32, [test "x$SUPPORT_WIN32" = "x1"])
440 AM_CONDITIONAL(SUPPORT_CEX100, [test "x$SUPPORT_EGL_PLATFORM_GDL" = "x1"])
441 AM_CONDITIONAL(SUPPORT_WAYLAND, [test "x$SUPPORT_WAYLAND" = "x1"])
442 AM_CONDITIONAL(SUPPORT_STUB, [test "x$SUPPORT_WIN32" = "x1" -o \
443 "x$SUPPORT_OSX" = "x1" -o \
444 "x$SUPPORT_WAYLAND" = "x1"])
446 AM_CONDITIONAL(USE_COGL, [test "x$SUPPORT_COGL" = "x1"])
447 AM_CONDITIONAL(USE_TSLIB, [test "x$have_tslib" = "xyes"])
448 AM_CONDITIONAL(USE_EVDEV, [test "x$have_evdev" = "xyes"])
449 AM_CONDITIONAL(USE_GLD, [test "x$have_gdl" = "xyes"])
451 dnl Instead of using AM_CFLAGS to ensure
452 dnl COGL_ENABLE_EXPERIMENTAL_2_0_API is defined while compiling clutter
453 dnl and cogl code we use a define in config.h instead. This helps ensure
454 dnl other tools such as glib-mkenums and gir-scanner don't end up
455 dnl using the define also.
456 AC_DEFINE([COGL_ENABLE_EXPERIMENTAL_2_0_API], [1], [Can use Cogl 2.0 API internally])
458 dnl strip leading spaces
459 CLUTTER_BACKENDS=${CLUTTER_BACKENDS#* }
460 AC_SUBST(CLUTTER_BACKENDS)
464 dnl === Clutter configuration =================================================
466 CLUTTER_CONFIG_DEFINES=
469 AS_IF([test "x$SUPPORT_X11" = "x1"],
470 [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
471 #define CLUTTER_WINDOWING_X11 \"x11\"
472 #define CLUTTER_INPUT_X11 \"x11\""])
473 AS_IF([test "x$SUPPORT_GDK" = "x1"],
474 [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
475 #define CLUTTER_WINDOWING_GDK \"gdk\"
476 #define CLUTTER_INPUT_GDK \"gdk\""])
477 AS_IF([test "x$SUPPORT_GLX" = "x1"],
478 [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
479 #define CLUTTER_WINDOWING_GLX \"glx\""])
480 AS_IF([test "x$SUPPORT_EGL" = "x1"],
481 [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
482 #define CLUTTER_WINDOWING_EGL \"eglnative\""])
483 AS_IF([test "x$SUPPORT_WAYLAND" = "x1"],
484 [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
485 #define CLUTTER_WINDOWING_WAYLAND \"wayland\""])
486 AS_IF([test "x$SUPPORT_OSX" = "x1"],
487 [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
488 #define CLUTTER_WINDOWING_OSX \"osx\"
489 #define CLUTTER_INPUT_OSX \"osx\""])
490 AS_IF([test "x$SUPPORT_WIN32" = "x1"],
491 [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
492 #define CLUTTER_WINDOWING_WIN32 \"win32\"
493 #define CLUTTER_INPUT_WIN32 \"win32\""])
494 AS_IF([test "x$SUPPORT_EGL_PLATFORM_GDL" = "x1"],
495 [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
496 #define CLUTTER_WINDOWING_CEX100 \"cex100\""])
497 AS_IF([test "x$SUPPORT_EVDEV" = "x1"],
498 [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
499 #define CLUTTER_INPUT_EVDEV \"evdev\""])
500 AS_IF([test "x$SUPPORT_TSLIB" = "x1"],
501 [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
502 #define CLUTTER_INPUT_TSLIB \"tslib\""])
504 AC_SUBST([CLUTTER_CONFIG_DEFINES])
506 dnl === Clutter substitutions kept for backwards compatibility ================
507 AC_SUBST([CLUTTER_WINSYS], [deprecated])
508 AC_SUBST([CLUTTER_WINSYS_BASE], [deprecated])
509 AC_SUBST([CLUTTER_STAGE_TYPE], [deprecated])
510 AC_SUBST([CLUTTER_SONAME_INFIX], [deprecated])
511 AC_SUBST([CLUTTER_FLAVOUR], [deprecated])
512 AC_SUBST([CLUTTER_COGL], [deprecated])
513 AC_SUBST([COGL_DRIVER], [deprecated])
515 dnl === Image loading backend =================================================
518 dnl === X11 checks, only for X11-based backends ===============================
523 AS_IF([test "x$SUPPORT_X11" = "x1"],
525 # base X11 includes and libraries
526 AC_MSG_CHECKING([for X11])
528 # start with pkg-config
529 PKG_CHECK_EXISTS([x11], [have_x11=yes], [have_x11=no])
530 AS_IF([test "x$have_x11" = "xyes"],
534 # we actually need to ask for CFLAGS and LIBS
535 X11_CFLAGS=`$PKG_CONFIG --cflags $X11_PC_FILES`
536 X11_LIBS=`$PKG_CONFIG --libs $X11_PC_FILES`
538 AC_MSG_RESULT([found])
541 # no pkg-config, let's go old school
544 AS_IF([test "x$no_x" = "xyes"],
545 [AC_MSG_ERROR([No X11 Libraries found])],
547 AS_IF([test "x$x_includes" != "xNONE" && test -n "$x_includes"],
548 [X11_CFLAGS=-I`echo $x_includes | sed -e "s/:/ -I/g"`])
550 AS_IF([test "x$x_libraries" != "xNONE" && test -n "$x_libraries"],
551 [X11_LIBS=-L`echo $x_libraries | sed -e "s/:/ -L/g"`])
553 AC_MSG_RESULT([found])
560 AC_MSG_CHECKING([for XEXT extension])
561 PKG_CHECK_EXISTS([xext], [have_xext=yes], [have_xext=no])
562 AS_IF([test "x$have_xext" = "xyes"],
564 AC_DEFINE(HAVE_XEXT, [1], [Define to 1 if we have the XEXT X extension])
566 X11_LIBS="$X11_LIBS -lXext"
567 X11_PC_FILES="$X11_PC_FILES xext"
568 X11_EXTS="$X11_EXTS xext"
570 AC_MSG_RESULT([found])
572 [AC_MSG_ERROR([Not found])]
576 AC_MSG_CHECKING([for XFIXES extension >= $XFIXES_REQ_VERSION])
577 PKG_CHECK_EXISTS([xfixes >= $XFIXES_REQ_VERSION], [have_xfixes=yes], [have_xfixes=no])
578 AS_IF([test "x$have_xfixes" = "xyes"],
580 AC_DEFINE(HAVE_XFIXES, [1], [Define to 1 if we have the XFIXES X extension])
582 X11_LIBS="$X11_LIBS -lXfixes"
583 X11_PC_FILES="$X11_PC_FILES xfixes >= $XFIXES_REQ_VERSION"
584 X11_EXTS="$X11_EXTS xfixes"
586 AC_MSG_RESULT([found])
588 [AC_MSG_ERROR([Not found])]
592 AC_MSG_CHECKING([for XDAMAGE extension])
593 PKG_CHECK_EXISTS([xdamage], [have_xdamage=yes], [have_xdamage=no])
594 AS_IF([test "x$have_xdamage" = "xyes"],
596 AC_DEFINE(HAVE_XDAMAGE, [1], [Define to 1 if we have the XDAMAGE X extension])
598 X11_LIBS="$X11_LIBS -lXdamage"
599 X11_PC_FILES="$X11_PC_FILES xdamage"
600 X11_EXTS="$X11_EXTS xdamage"
602 AC_MSG_RESULT([found])
604 [AC_MSG_ERROR([not found])]
607 # XCOMPOSITE (optional)
608 AC_MSG_CHECKING([for XCOMPOSITE extension >= $XCOMPOSITE_REQ_VERSION])
609 PKG_CHECK_EXISTS([xcomposite >= $XCOMPOSITE_REQ_VERSION], [have_xcomposite=yes], [have_xcomposite=no])
610 AS_IF([test "x$have_xcomposite" = "xyes"],
612 AC_DEFINE(HAVE_XCOMPOSITE, [1], [Define to 1 if we have the XCOMPOSITE X extension])
614 X11_LIBS="$X11_LIBS -lXcomposite"
615 X11_PC_FILES="$X11_PC_FILES xcomposite >= $XCOMPOSITE_REQ_VERSION"
616 X11_EXTS="$X11_EXTS xcomposite"
618 AC_MSG_RESULT([found])
620 [AC_MSG_ERROR([not found])]
623 # X Generic Extensions (optional)
624 clutter_save_CPPFLAGS="$CPPFLAGS"
625 CPPFLAGS="$CPPFLAGS $X11_CFLAGS"
627 clutter_save_LIBS="$LIBS"
628 LIBS="$LIBS $X11_LIBS"
631 AC_CHECK_FUNC([XGetEventData],
633 AC_DEFINE([HAVE_XGE], [1], [Define to 1 if X Generic Extensions is available])
635 X11_EXTS="$X11_EXTS xge"
638 CPPFLAGS="$clutter_save_CPPFLAGS"
639 LIBS="$clutter_save_LIBS"
642 AC_ARG_ENABLE([xinput],
643 [AS_HELP_STRING([--enable-xinput], [Use the XI X extension])],
647 AS_IF([test "x$enable_xinput" = "xyes"],
649 PKG_CHECK_EXISTS([xi], [have_xinput=yes], [have_xinput=no])
655 AS_CASE([$have_xinput],
659 AC_CHECK_HEADERS([X11/extensions/XInput2.h],
662 AC_DEFINE([HAVE_XINPUT_2],
664 [Define to 1 if XI2 is available])
668 AC_DEFINE([HAVE_XINPUT],
670 [Define to 1 if XInput is available])
673 X11_LIBS="$X11_LIBS $XINPUT_LIBS"
674 X11_PC_FILES="$X11_PC_FILES xi"
675 X11_EXTS="$X11_EXTS xi"
682 [AC_MSG_ERROR([Invalid argument for --enable-xinput])]
686 clutter_save_CPPFLAGS="$CPPFLAGS"
687 CPPFLAGS="$CPPFLAGS $X11_CFLAGS"
689 clutter_save_LIBS="$LIBS"
690 LIBS="$LIBS $X11_LIBS"
693 AC_CHECK_FUNC([XkbQueryExtension],
695 AC_DEFINE(HAVE_XKB, 1, [Define to use XKB extension])
698 X11_EXTS="$X11_EXTS xkb"
701 CPPFLAGS="$clutter_save_CPPFLAGS"
702 LIBS="$clutter_save_LIBS"
705 BACKEND_PC_FILES="$BACKEND_PC_FILES $X11_PC_FILES"
706 FLAVOUR_LIBS="$FLAVOUR_LIBS $X11_LIBS"
707 FLAVOUR_CFLAGS="$FLAVOUR_CFLAGS $X11_CFLAGS"
711 AM_CONDITIONAL([BUILD_XI2], [test "x$have_xinput2" = "xyes"])
712 AM_CONDITIONAL([X11_TESTS], [test "x$x11_tests" = "xyes"])
714 X11_EXTS=${X11_EXTS#* }
718 dnl === Enable debug level ====================================================
720 m4_define([debug_default], [m4_if(m4_eval(clutter_minor_version % 2), [1], [yes], [minimum])])
721 AC_ARG_ENABLE([debug],
722 [AS_HELP_STRING([--enable-debug=@<:@no/minimum/yes@:>@],
723 [Control Clutter debugging level @<:@default=]debug_default[@:>@])],
725 [enable_debug=debug_default])
727 AS_CASE([$enable_debug],
731 test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
732 CLUTTER_DEBUG_CFLAGS="-DCLUTTER_ENABLE_DEBUG"
736 [CLUTTER_DEBUG_CFLAGS="-DCLUTTER_ENABLE_DEBUG -DG_DISABLE_CAST_CHECKS"],
739 [CLUTTER_DEBUG_CFLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"],
741 [AC_MSG_ERROR([Unknown argument for --enable-debug])]
744 AC_SUBST(CLUTTER_DEBUG_CFLAGS)
746 dnl === Enable deprecation guards ==================================================
748 m4_define([deprecated_default],
749 [m4_if(m4_eval(clutter_minor_version % 2),
754 AC_ARG_ENABLE([deprecated],
755 [AS_HELP_STRING([--enable-deprecated=@<:@no/yes@:>@],
756 [Whether deprecated symbols should be disabled when compiling Clutter @<:@default=]deprecated_default[@:>@])],
758 [enable_deprecated=deprecated_default])
760 AS_CASE([$enable_deprecated],
764 CLUTTER_DEPRECATED_CFLAGS="-DG_DISABLE_SINGLE_INCLUDES -DCOGL_DISABLE_DEPRECATED"
769 CLUTTER_DEPRECATED_CFLAGS="-DGLIB_DISABLE_DEPRECATION_WARNINGS -DCLUTTER_DISABLE_DEPRECATION_WARNINGS"
772 [AC_MSG_ERROR([Unknown argument for --enable-deprecated])]
775 AC_SUBST([CLUTTER_DEPRECATED_CFLAGS])
778 dnl === Conformance test suite ================================================
780 AC_ARG_ENABLE([conformance],
781 [AS_HELP_STRING([--enable-conformance=@<:@no/yes@:>@],
782 [Build conformance test suite @<:@default=yes@:>@])],
784 [enable_conformance=yes])
786 AM_CONDITIONAL([BUILD_TESTS], [test "x$enable_conformance" = "xyes"])
788 dnl === Profiling =============================================================
790 m4_define([profile_default], [no])
791 AC_ARG_ENABLE(profile,
792 AS_HELP_STRING([--enable-profile=@<:@no/yes@:>@],
793 [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@:>@]),
795 [enable_profile=profile_default])
797 AS_CASE([$enable_profile],
801 AS_IF([test "x$GCC" = "xyes"],
803 PKG_CHECK_MODULES([PROFILE_DEP], [uprof-0.3])
804 CLUTTER_PROFILE_CFLAGS="-DCLUTTER_ENABLE_PROFILE $PROFILE_DEP_CFLAGS"
805 CLUTTER_PROFILE_LDFLAGS="$PROFILE_DEP_LIBS"
807 AS_IF([test "x$enable_debug" = "xyes"], [CLUTTER_PROFILE_CFLAGS+=" -DUPROF_DEBUG"])
810 AC_MSG_ERROR([--enable-profile is currently only supported if using GCC])
816 CLUTTER_PROFILE_CFLAGS=""
817 CLUTTER_PROFILE_LDFLAGS=""
820 [*], [AC_MSG_ERROR([Invalid value for --enable-profile])]
822 AM_CONDITIONAL(PROFILE, test "x$enable_profile" != "xno")
823 AC_SUBST(CLUTTER_PROFILE_CFLAGS)
824 AC_SUBST(CLUTTER_PROFILE_LDFLAGS)
826 dnl === Coverage report =======================================================
828 AC_PATH_PROG([GCOV], [gcov], [enable_gcov=no])
830 AC_MSG_CHECKING([whether to build with gcov testing])
832 AC_ARG_ENABLE([gcov],
833 [AS_HELP_STRING([--enable-gcov],
834 [Whether to enable coverage testing (requires gcc
839 AS_IF([test "x$enable_gcov" = "xyes" && test "x$GCC" = "xyes"],
841 AS_IF([test "x$enable_conformance" = "xno"],
842 [AC_MSG_WARN([Conformance test suite is disabled, the coverage report will be incomplete])],
843 [AC_MSG_RESULT([yes])]
846 GCOV_CFLAGS="-g -O0 -fprofile-arcs -ftest-coverage"
847 GCOV_LDFLAGS="-lgcov"
849 [AC_MSG_RESULT([no])]
852 AM_CONDITIONAL([GCOV_ENABLED], [test "x$enable_gcov" = "xyes"])
853 AC_SUBST([GCOV_CFLAGS])
854 AC_SUBST([GCOV_LDFLAGS])
856 dnl === Enable strict compiler flags ==========================================
858 # use strict compiler flags only when building from git; the rules for
859 # distcheck will take care of turning this on when making a release
860 m4_define([maintainer_flags_default], [m4_if(m4_eval(clutter_micro_version % 2), [1], [yes], [no])])
861 AC_ARG_ENABLE([maintainer-flags],
862 [AS_HELP_STRING([--enable-maintainer-flags=@<:@no/yes/error@:>@],
863 [Use strict compiler flags @<:@default=]maintainer_flags_default[@:>@])],
865 [enable_maintainer_flags=maintainer_flags_default])
867 MAINTAINER_COMPILER_FLAGS="-Wall -Wshadow -Wcast-align -Wuninitialized
868 -Wno-strict-aliasing -Wempty-body -Wformat
869 -Wformat-security -Winit-self
870 -Wdeclaration-after-statement -Wvla
873 AS_CASE([$enable_maintainer_flags],
876 AS_COMPILER_FLAGS([MAINTAINER_CFLAGS], [$MAINTAINER_COMPILER_FLAGS])
885 MAINTAINER_COMPILER_FLAGS="$MAINTAINER_COMPILER_FLAGS -Werror"
886 AS_COMPILER_FLAGS([MAINTAINER_CFLAGS], [$MAINTAINER_COMPILER_FLAGS])
890 [AC_MSG_ERROR([Invalid option for --enable-maintainer-flags])]
893 # strip leading spaces
894 MAINTAINER_CFLAGS=${MAINTAINER_CFLAGS#* }
895 AC_SUBST(MAINTAINER_CFLAGS)
897 dnl === Dependencies, compiler flags and linker libraries =====================
898 # strip leading space
899 BACKEND_PC_FILES=${BACKEND_PC_FILES#* }
901 CLUTTER_REQUIRES="$CLUTTER_BASE_PC_FILES $IMAGE_PC_FILES $BACKEND_PC_FILES"
902 PKG_CHECK_MODULES(CLUTTER_DEPS, [$CLUTTER_REQUIRES])
903 AC_SUBST(CLUTTER_REQUIRES)
905 CLUTTER_CFLAGS="$FLAVOUR_CFLAGS $CLUTTER_DEPS_CFLAGS $CLUTTER_PROFILE_CFLAGS $GLIB_CFLAGS"
906 CLUTTER_LIBS="$FLAVOUR_LIBS $CLUTTER_DEPS_LIBS $CLUTTER_PROFILE_LDFLAGS $GLIB_LIBS"
907 AC_SUBST(CLUTTER_CFLAGS)
908 AC_SUBST(CLUTTER_LIBS)
911 dnl === GObject-Introspection check ===========================================
913 GOBJECT_INTROSPECTION_CHECK([gi_req_version])
915 dnl === GTK Doc check =========================================================
917 GTK_DOC_CHECK([gtk_doc_req_version], [--flavour no-tmpl])
919 # we don't want to build the documentation from a Git clone unless we
920 # explicitly tell configure to do so; this allows avoiding to recurse into
921 # the documentation directory when building Clutter inside Poky for a
922 # target device that doesn't have gtk-doc installed. for reference
923 # see: http://bugzilla.openedhand.com/show_bug.cgi?id=1047
925 # we use autogen.sh as it exists only inside the Git clones, and it
926 # is not packaged into tarballs.
927 AM_CONDITIONAL([BUILD_GTK_DOC], [test "x$enable_gtk_doc" = "xyes" || test ! -f "autogen.sh"])
929 # prefixes for fixing gtk-doc references
930 CAIRO_PREFIX="`$PKG_CONFIG --variable=prefix cairo`"
931 GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
932 PANGO_PREFIX="`$PKG_CONFIG --variable=prefix pango`"
933 COGL_PREFIX="`$PKG_CONFIG --variable=prefix cogl-1.0`"
934 ATK_PREFIX="`$PKG_CONFIG --variable=prefix atk`"
935 AC_SUBST(CAIRO_PREFIX)
936 AC_SUBST(GLIB_PREFIX)
937 AC_SUBST(PANGO_PREFIX)
938 AC_SUBST(COGL_PREFIX)
941 dnl === Manual ================================================================
943 AC_ARG_ENABLE([docs],
944 [AS_HELP_STRING([--enable-docs=@<:@no/yes@:>@],
945 [Build optional documentation; requires xsltproc and jw.])],
946 [enable_docs=$enableval],
950 AS_IF([test "x$enable_docs" = "xyes"],
952 AC_PATH_PROG(JW, [jw], [no])
953 AS_IF([test "x$JW" = "xno"],
955 AC_MSG_WARN([jw not found; pdf generation has been disabled])
959 AC_PATH_PROG(XSLTPROC, [xsltproc], [no])
960 AS_IF([test "x$XSLTPROC" = "xno"],
962 AC_MSG_ERROR([xsltproc not found])
967 AM_CONDITIONAL(ENABLE_DOCS, [test "x$enable_docs" = "xyes"])
968 AM_CONDITIONAL(ENABLE_PDFS, [test "x$enable_pdfs" = "xyes"])
970 dnl === I18N ==================================================================
972 AM_GNU_GETTEXT_VERSION([0.17])
973 AM_GNU_GETTEXT([external])
975 GETTEXT_PACKAGE="clutter-1.0"
976 AC_SUBST(GETTEXT_PACKAGE)
977 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],
978 ["$GETTEXT_PACKAGE"],
979 [The prefix for our gettext translation domains.])
982 dnl ===========================================================================
990 build/autotools/Makefile
994 clutter/clutter-config.h
995 clutter/clutter-version.h
996 clutter/clutter-$CLUTTER_API_VERSION.pc:clutter/clutter.pc.in
998 clutter/cally/cally-$CLUTTER_API_VERSION.pc:clutter/cally/cally.pc.in
1000 clutter/egl/clutter-cex100.h
1003 tests/accessibility/Makefile
1004 tests/conform/Makefile
1005 tests/conform/test-launcher.sh
1007 tests/interactive/Makefile
1008 tests/interactive/wrapper.sh
1009 tests/micro-bench/Makefile
1010 tests/performance/Makefile
1013 doc/reference/Makefile
1014 doc/reference/clutter/Makefile
1015 doc/reference/clutter/clutter-docs.xml
1016 doc/reference/cally/Makefile
1017 doc/reference/cally/cally-docs.xml
1019 doc/cookbook/Makefile
1020 doc/cookbook/clutter-cookbook.xml
1021 doc/cookbook/examples/Makefile
1028 dnl === Summary ===============================================================
1031 echo "Clutter - $VERSION (${CLUTTER_RELEASE_STATUS})"
1036 echo " Prefix: ${prefix}"
1037 echo " Libdir: ${libdir}"
1038 echo " Sysconfdir: ${sysconfdir}"
1040 # Compiler/Debug related flags
1042 echo " • Compiler options:"
1043 echo " Clutter debug level: ${enable_debug}"
1044 echo " Compiler flags: ${CFLAGS} ${MAINTAINER_CFLAGS}"
1045 echo " Profiling enabled: ${enable_profile}"
1046 echo " Enable coverage tests: ${enable_gcov}"
1047 echo " Enable deprecated symbols: ${enable_deprecated}"
1051 echo " • Documentation:"
1052 echo " Build API Reference: ${enable_gtk_doc}"
1053 echo " Build Additional Documentation: ${enable_docs} (Generate PDF: ${enable_pdfs})"
1058 echo " Build introspection data: ${enable_introspection}"
1059 echo " Build conformance test suite: ${enable_conformance}"
1060 echo " Build X11-specific tests: ${x11_tests}"
1062 # Clutter backend related flags
1064 echo " • Clutter Backends:"
1066 if test "x$experimental_backend" = "xno"; then
1067 echo " Windowing systems: ${CLUTTER_BACKENDS}"
1069 echo " Windowing systems: ${CLUTTER_BACKENDS} (WARNING: Experimental backends enabled)"
1072 if test "x$SUPPORT_X11" = "x1"; then
1074 echo " - X11 backend options:"
1075 echo " Enabled extensions: ${X11_EXTS}"
1076 echo " Build X11-specific tests: ${x11_tests}"
1079 if test "x$SUPPORT_EGL" = "x1"; then
1081 echo " - EGL backend options:"
1082 echo " Enable TSLib: ${have_tslib}"
1083 echo " Enable evdev: ${have_evdev}"
1084 echo " Enable GDL: ${have_gdl}"
1089 # General warning about experimental features
1090 if test "x$experimental_backend" = "xyes"; then
1092 echo "☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠"
1093 echo "*WARNING* *WARNING* *WARNING* *WARNING* *WARNING* *WARNING* *WARNING*"
1095 echo " The stability of your build might be affected by one or more"
1096 echo " experimental backends or experimental and unsupported features"
1098 echo "*WARNING* *WARNING* *WARNING* *WARNING* *WARNING* *WARNING* *WARNING*"
1099 echo "☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠"