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"
84 AC_MSG_CHECKING([if building for some Win32 platform])
86 [*-*-mingw*|*-*-cygwin*],
88 CLUTTER_LT_LDFLAGS="$CLUTTER_LT_LDFLAGS -no-undefined"
94 AC_MSG_RESULT([$platform_win32])
95 AM_CONDITIONAL(OS_WIN32, [test "$platform_win32" = "yes"])
97 AC_CHECK_HEADER([OpenGL/gl.h], [platform_quartz=yes], [platform_quartz=no])
98 AM_CONDITIONAL(OS_QUARTZ, [test "$platform_quartz" = "yes"])
100 AC_SUBST(CLUTTER_LT_VERSION)
101 AC_SUBST(CLUTTER_LT_LDFLAGS)
103 dnl ========================================================================
105 # Checks for programs.
108 # require libtool >= 2.2
110 LT_INIT([disable-static])
112 # Checks for header files.
115 # required versions for dependencies
116 m4_define([glib_req_version], [2.31.0])
117 m4_define([cogl_req_version], [1.9.1])
118 m4_define([json_glib_req_version], [0.12.0])
119 m4_define([atk_req_version], [2.1.5])
120 m4_define([cairo_req_version], [1.10])
121 m4_define([pango_req_version], [1.20])
122 m4_define([gi_req_version], [0.9.5])
123 m4_define([uprof_req_version], [0.3])
124 m4_define([gtk_doc_req_version], [1.15])
125 m4_define([xfixes_req_version], [3])
126 m4_define([xcomposite_req_version], [0.4])
128 AC_SUBST([GLIB_REQ_VERSION], [glib_req_version])
129 AC_SUBST([COGL_REQ_VERSION], [cogl_req_version])
130 AC_SUBST([JSON_GLIB_REQ_VERSION], [json_glib_req_version])
131 AC_SUBST([ATK_REQ_VERSION], [atk_req_version])
132 AC_SUBST([CAIRO_REQ_VERSION], [cairo_req_version])
133 AC_SUBST([PANGO_REQ_VERSION], [pango_req_version])
134 AC_SUBST([GI_REQ_VERSION], [gi_req_version])
135 AC_SUBST([UPROF_REQ_VERSION], [uprof_req_version])
136 AC_SUBST([GTK_DOC_REQ_VERSION], [gtk_doc_req_version])
137 AC_SUBST([XFIXES_REQ_VERSION], [xfixes_req_version])
138 AC_SUBST([XCOMPOSITE_REQ_VERSION], [xcomposite_req_version])
140 # Checks for typedefs, structures, and compiler characteristics.
141 AM_PATH_GLIB_2_0([glib_req_version],
143 [AC_MSG_ERROR([glib-2.0 is required])],
144 [gobject gthread gmodule-no-export])
146 # Check for -Bsymbolic-functions to avoid intra-library PLT jumps
147 AC_ARG_ENABLE([Bsymbolic],
148 [AS_HELP_STRING([--disable-Bsymbolic],
149 [Avoid linking with -Bsymbolic])],
152 saved_LDFLAGS="${LDFLAGS}"
153 AC_MSG_CHECKING([for -Bsymbolic-functions linker flag])
154 LDFLAGS=-Wl,-Bsymbolic-functions
155 AC_TRY_LINK([], [int main (void) { return 0; }],
164 LDFLAGS="${saved_LDFLAGS}"
167 AS_IF([test "x$enable_Bsymbolic" = "xyes"], [CLUTTER_LINK_FLAGS=-Wl[,]-Bsymbolic-functions])
168 AC_SUBST(CLUTTER_LINK_FLAGS)
170 dnl ========================================================================
173 AS_IF([test "x$platform_win32" = "xyes"], [CLUTTER_FLAVOUR=win32],
174 [test "x$platform_quartz" = "xyes"], [CLUTTER_FLAVOUR=osx],
175 [CLUTTER_FLAVOUR=glx])
180 CLUTTER_WINSYS_BASE_LIB=
183 experimental_backend=no
185 AC_ARG_WITH([flavour],
186 [AS_HELP_STRING([--with-flavour=@<:@glx/opengl-egl-xlib/wayland/eglx/eglnative/osx/win32/cex100@:>@],
187 [Select the Clutter window system backend])],
188 [CLUTTER_FLAVOUR=$with_flavour])
190 # base dependencies for core
191 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"
193 # backend specific pkg-config files
196 dnl === Clutter windowing system backend ======================================
198 AS_CASE([$CLUTTER_FLAVOUR],
202 CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_X11"
209 CLUTTER_WINSYS_BASE=cogl
210 CLUTTER_SONAME_INFIX=glx
212 # Mesa 7.3 added a GL pkg-config file, finally
213 PKG_CHECK_EXISTS([gl],
214 [BACKEND_PC_FILES="$BACKEND_PC_FILES gl"],
215 # if a pkg-config file isn't found just add -lGL
216 # and hope for the best.
217 [FLAVOUR_LIBS="$FLAVOUR_LIBS -lGL"])
219 # We might fall back to DRM for sync-to-vblank on GLX
220 PKG_CHECK_EXISTS([libdrm],
222 AC_DEFINE([HAVE_DRM], [1], [Have libdrm support])
223 BACKEND_PC_FILES="$BACKEND_PC_FILES libdrm"
230 CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_GDK"
232 # We don't claim to support X11 (even though that's the preferred
233 # GDK backend), to avoid building all the ClutterX11 stuff
237 CLUTTER_WINSYS_BASE=cogl
238 CLUTTER_SONAME_INFIX=gdk
240 BACKEND_PC_FILES="$BACKEND_PC_FILES gdk-3.0"
241 PKG_CHECK_EXISTS([gl], [BACKEND_PC_FILES="$BACKEND_PC_FILES gl"], [])
246 CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_X11"
247 CLUTTER_EGL_BACKEND="generic"
252 SUPPORT_EGL_PLATFORM_POWERVR_X11=1
255 CLUTTER_WINSYS_BASE=cogl
256 # I think this winsys can be API and ABI compatible with the
257 # glx flavour so we can also be cheeky and use the same soname
258 CLUTTER_SONAME_INFIX=glx
260 PKG_CHECK_EXISTS([gl], [BACKEND_PC_FILES="$BACKEND_PC_FILES gl"], [])
261 PKG_CHECK_EXISTS([egl], [BACKEND_PC_FILES="$BACKEND_PC_FILES egl"], [])
266 experimental_backend="yes"
267 CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_WAYLAND"
271 CLUTTER_WINSYS=wayland
272 CLUTTER_SONAME_INFIX=wayland
274 PKG_CHECK_EXISTS([gl], [BACKEND_PC_FILES="$BACKEND_PC_FILES gl"], [])
275 PKG_CHECK_EXISTS([egl], [BACKEND_PC_FILES="$BACKEND_PC_FILES egl"], [])
276 PKG_CHECK_EXISTS([wayland-client xkbcommon],
277 [BACKEND_PC_FILES="$BACKEND_PC_FILES wayland-client xkbcommon"], [])
282 CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_X11"
283 CLUTTER_EGL_BACKEND="generic"
288 SUPPORT_EGL_PLATFORM_POWERVR_X11=1
291 CLUTTER_WINSYS_BASE=cogl
292 CLUTTER_SONAME_INFIX=eglx
297 CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_EGL"
298 CLUTTER_EGL_BACKEND="generic"
301 SUPPORT_EGL_PLATFORM_POWERVR_NULL=1
303 PKG_CHECK_MODULES(TSLIB, [tslib-1.0], [have_tslib=yes], [have_tslib=no])
304 AS_IF([test "x$have_tslib" = "xyes"],
305 [AC_DEFINE([HAVE_TSLIB], [1], [Have tslib for touchscreen handling])]
309 PKG_CHECK_MODULES(EVDEV, [gudev-1.0 xkbcommon],
310 [have_evdev=yes], [have_evdev=no])
311 AS_IF([test "x$have_evdev" = "xyes"],
312 [AC_DEFINE([HAVE_EVDEV], 1,
313 [Have evdev support for input handling])]
316 # Make sure we don't enable tslib and evdev at the same time, we
317 # don't support multiple event backends yet.
318 AS_IF([test "x$have_tslib" = "xyes" -a "x$have_evdev" = "xyes"],
319 [AC_MSG_ERROR([Cannot enable both tslib and evdev events])])
321 FLAVOUR_LIBS="$FLAVOUR_LIBS $TSLIB_LIBS $EVDEV_LIBS"
322 FLAVOUR_CFLAGS="$FLAVOUR_CFLAGS $TSLIB_CFLAGS $EVDEV_CFLAGS"
325 CLUTTER_SONAME_INFIX=eglnative
330 CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_EGL"
331 CLUTTER_EGL_BACKEND="cex100"
334 SUPPORT_EGL_PLATFORM_GDL=1
336 # The cex100 is a small specialization of the EGL backend
338 CLUTTER_SONAME_INFIX=cex100
341 AC_CHECK_HEADERS([libgdl.h], [found_gdl=yes])
342 AS_IF([test "x$found_gdl" = "xno"],
343 [AC_CHECK_HEADERS([CE4100/libgdl.h],
345 FLAVOUR_CFLAGS="-I/usr/include/CE4100"
347 CLUTTER_CEX100_LIBGDL_PREFIX=CE4100/
350 AC_SUBST(CLUTTER_CEX100_LIBGDL_PREFIX)
352 AS_IF([test x"$found_gdl" = "xno"], [AC_MSG_ERROR([libgdl.h not found])])
355 PKG_CHECK_MODULES(EVDEV, [gudev-1.0 xkbcommon],
356 [have_evdev=yes], [have_evdev=no])
357 AS_IF([test "x$have_evdev" = "xyes"],
358 [AC_DEFINE([HAVE_EVDEV], 1,
359 [Have evdev support for input handling])]
362 FLAVOUR_CFLAGS="$FLAVOUR_CFLAGS $EVDEV_CFLAGS"
363 FLAVOUR_LIBS="$FLAVOUR_LIBS -lgdl $EVDEV_LIBS"
368 CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_OSX"
370 AC_DEFINE([HAVE_CLUTTER_OSX], [1], [Have the OSX backend])
372 FLAVOUR_LIBS="$FLAVOUR_LIBS -framework Cocoa -framework OpenGL"
375 CLUTTER_SONAME_INFIX=osx
380 CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_WIN32"
381 AC_DEFINE([HAVE_CLUTTER_WIN32], [1], [Have the Win32 backend])
383 FLAVOUR_LIBS="$FLAVOUR_LIBS -lopengl32 -lgdi32 -lwinmm"
384 FLAVOUR_CFLAGS="$FLAVOUR_CFLAGS -D_WIN32_WINNT=0x0500"
386 AC_CHECK_TOOL(WINDRES, windres, no)
387 if test "$WINDRES" = no; then
388 AC_MSG_ERROR([*** windres is required])
392 CLUTTER_SONAME_INFIX=win32
395 [AC_MSG_ERROR([Invalid backend for Clutter])]
398 AS_IF([test "x$SUPPORT_X11" = "x1"],
400 # we use fontconfig API and pango-fc when the fontconfig
401 # configuration changes
402 PKG_CHECK_EXISTS([pangoft2],
404 AC_DEFINE([HAVE_PANGO_FT2], [1], [Supports PangoFt2])
405 BACKEND_PC_FILES="$BACKEND_PC_FILES pangoft2"
410 AS_IF([test "x$SUPPORT_GLX" = "x1"],
412 AC_DEFINE([HAVE_CLUTTER_GLX], [1], [Have the GLX backend])
415 AS_IF([test "x$SUPPORT_WAYLAND" = "x1"],
417 AC_DEFINE([HAVE_CLUTTER_WAYLAND], [1], [Have the Wayland backend])
420 AS_IF([test "x$SUPPORT_EGL" = "x1"],
422 AC_DEFINE([HAVE_CLUTTER_EGL], [1], [Have the EGL backend])
425 AS_IF([test "x$CLUTTER_EGL_BACKEND" = "xgeneric"],
426 AC_DEFINE([CLUTTER_EGL_BACKEND_GENERIC], [1], [Use Generic EGL backend]))
428 AS_IF([test "x$CLUTTER_EGL_BACKEND" = "xcex100"],
429 AC_DEFINE([CLUTTER_EGL_BACKEND_CEX100], [1], [Use CEX100 EGL backend]))
431 # winsys conditionals for use in automake files...
432 AM_CONDITIONAL(SUPPORT_GLX, [test "x$SUPPORT_GLX" = "x1"])
433 AM_CONDITIONAL(SUPPORT_X11, [test "x$SUPPORT_X11" = "x1"])
434 AM_CONDITIONAL(SUPPORT_XLIB, [test "x$SUPPORT_XLIB" = "x1"])
435 AM_CONDITIONAL(SUPPORT_GDK, [test "x$SUPPORT_GDK" = "x1"])
436 AM_CONDITIONAL(SUPPORT_EGL, [test "x$SUPPORT_EGL" = "x1"])
437 AM_CONDITIONAL(SUPPORT_OSX, [test "x$CLUTTER_WINSYS" = "xosx"])
438 AM_CONDITIONAL(SUPPORT_WIN32, [test "x$CLUTTER_WINSYS" = "xwin32"])
439 AM_CONDITIONAL(SUPPORT_CEX100, [test "x$SUPPORT_EGL_PLATFORM_GDL" = "x1"])
440 AM_CONDITIONAL(SUPPORT_WAYLAND, [test "x$CLUTTER_WINSYS" = "xwayland"])
441 AM_CONDITIONAL(SUPPORT_STUB, [test "x$CLUTTER_WINSYS" = "xwin32" -o \
442 "x$CLUTTER_WINSYS" = "xosx" -o \
443 "x$CLUTTER_WINSYS" = "xwayland"])
445 AM_CONDITIONAL(USE_TSLIB, [test "x$have_tslib" = "xyes"])
446 AM_CONDITIONAL(SUPPORT_EVDEV, [test "x$have_evdev" = "xyes"])
448 dnl Instead of using AM_CFLAGS to ensure
449 dnl COGL_ENABLE_EXPERIMENTAL_2_0_API is defined while compiling clutter
450 dnl and cogl code we use a define in config.h instead. This helps ensure
451 dnl other tools such as glib-mkenums and gir-scanner don't end up
452 dnl using the define also.
453 AC_DEFINE([COGL_ENABLE_EXPERIMENTAL_2_0_API], [1], [Can use Cogl 2.0 API internally])
455 dnl === Clutter configuration =================================================
457 CLUTTER_CONFIG_DEFINES=
460 AS_IF([test "x$SUPPORT_XLIB" = "x1"],
461 [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
462 #define CLUTTER_WINDOWING_X11 1"])
463 AS_IF([test "x$SUPPORT_GDK" = "x1"],
464 [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
465 #define CLUTTER_WINDOWING_GDK 1"])
466 AS_IF([test "x$SUPPORT_GLX" = "x1"],
467 [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
468 #define CLUTTER_WINDOWING_GLX 1"])
469 AS_IF([test "x$SUPPORT_EGL" = "x1"],
470 [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
471 #define CLUTTER_WINDOWING_EGL 1"])
472 AS_IF([test "x$CLUTTER_WINSYS" = "xwayland"],
473 [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
474 #define CLUTTER_WINDOWING_WAYLAND 1"])
475 AS_IF([test "x$CLUTTER_WINSYS" = "xosx"],
476 [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
477 #define CLUTTER_WINDOWING_OSX 1"])
478 AS_IF([test "x$CLUTTER_WINSYS" = "xwin32"],
479 [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
480 #define CLUTTER_WINDOWING_WIN32 1"])
481 AS_IF([test "x$SUPPORT_EGL_PLATFORM_GDL" = "x1"],
482 [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
483 #define CLUTTER_WINDOWING_CEX100 1"])
485 AC_SUBST([CLUTTER_CONFIG_DEFINES])
487 dnl === Clutter substitutions =================================================
488 # Eventually the idea of a winsys should be hidden from Clutter and moved
489 # into Cogl, but for now we have CLUTTER_WINSYS...
490 AC_SUBST([CLUTTER_WINSYS])
491 # The same goes for the winsys-base...
492 AC_SUBST([CLUTTER_WINSYS_BASE])
493 AC_SUBST(CLUTTER_STAGE_TYPE)
494 AC_SUBST(CLUTTER_SONAME_INFIX)
496 CLUTTER_WINSYS_LIB=libclutter-$CLUTTER_SONAME_INFIX-$CLUTTER_API_VERSION.la
497 AC_SUBST([CLUTTER_WINSYS_LIB])
499 dnl === Clutter substitutions kept for backwards compatibility ================
500 AC_SUBST([CLUTTER_FLAVOUR])
501 CLUTTER_COGL=undefined
502 AC_SUBST([CLUTTER_COGL])
504 dnl === Image loading backend =================================================
507 dnl === X11 checks, only for X11-based backends ===============================
511 AS_IF([test "x$SUPPORT_XLIB" = "x1"],
513 # base X11 includes and libraries
514 AC_MSG_CHECKING([for X11])
516 # start with pkg-config
517 PKG_CHECK_EXISTS([x11], [have_x11=yes], [have_x11=no])
518 AS_IF([test "x$have_x11" = "xyes"],
522 # we actually need to ask for CFLAGS and LIBS
523 X11_CFLAGS=`$PKG_CONFIG --cflags $X11_PC_FILES`
524 X11_LIBS=`$PKG_CONFIG --libs $X11_PC_FILES`
526 AC_MSG_RESULT([found])
529 # no pkg-config, let's go old school
532 AS_IF([test "x$no_x" = "xyes"],
533 [AC_MSG_ERROR([No X11 Libraries found])],
535 AS_IF([test "x$x_includes" != "xNONE" && test -n "$x_includes"],
536 [X11_CFLAGS=-I`echo $x_includes | sed -e "s/:/ -I/g"`])
538 AS_IF([test "x$x_libraries" != "xNONE" && test -n "$x_libraries"],
539 [X11_LIBS=-L`echo $x_libraries | sed -e "s/:/ -L/g"`])
541 AC_MSG_RESULT([found])
548 AC_MSG_CHECKING([for XEXT extension])
549 PKG_CHECK_EXISTS([xext], [have_xext=yes], [have_xext=no])
550 AS_IF([test "x$have_xext" = "xyes"],
552 AC_DEFINE(HAVE_XEXT, [1], [Define to 1 if we have the XEXT X extension])
554 X11_LIBS="$X11_LIBS -lXext"
555 X11_PC_FILES="$X11_PC_FILES xext"
557 AC_MSG_RESULT([found])
559 [AC_MSG_ERROR([Not found])]
563 AC_MSG_CHECKING([for XFIXES extension >= $XFIXES_REQ_VERSION])
564 PKG_CHECK_EXISTS([xfixes >= $XFIXES_REQ_VERSION], [have_xfixes=yes], [have_xfixes=no])
565 AS_IF([test "x$have_xfixes" = "xyes"],
567 AC_DEFINE(HAVE_XFIXES, [1], [Define to 1 if we have the XFIXES X extension])
569 X11_LIBS="$X11_LIBS -lXfixes"
570 X11_PC_FILES="$X11_PC_FILES xfixes >= $XFIXES_REQ_VERSION"
572 AC_MSG_RESULT([found])
574 [AC_MSG_ERROR([Not found])]
578 AC_MSG_CHECKING([for XDAMAGE extension])
579 PKG_CHECK_EXISTS([xdamage], [have_xdamage=yes], [have_xdamage=no])
580 AS_IF([test "x$have_xdamage" = "xyes"],
582 AC_DEFINE(HAVE_XDAMAGE, [1], [Define to 1 if we have the XDAMAGE X extension])
584 X11_LIBS="$X11_LIBS -lXdamage"
585 X11_PC_FILES="$X11_PC_FILES xdamage"
587 AC_MSG_RESULT([found])
589 [AC_MSG_ERROR([not found])]
592 # XCOMPOSITE (optional)
593 AC_MSG_CHECKING([for XCOMPOSITE extension >= $XCOMPOSITE_REQ_VERSION])
594 PKG_CHECK_EXISTS([xcomposite >= $XCOMPOSITE_REQ_VERSION], [have_xcomposite=yes], [have_xcomposite=no])
595 AS_IF([test "x$have_xcomposite" = "xyes"],
597 AC_DEFINE(HAVE_XCOMPOSITE, [1], [Define to 1 if we have the XCOMPOSITE X extension])
599 X11_LIBS="$X11_LIBS -lXcomposite"
600 X11_PC_FILES="$X11_PC_FILES xcomposite >= $XCOMPOSITE_REQ_VERSION"
602 AC_MSG_RESULT([found])
604 [AC_MSG_ERROR([not found])]
607 # X Generic Extensions (optional)
608 clutter_save_CPPFLAGS="$CPPFLAGS"
609 CPPFLAGS="$CPPFLAGS $X11_CFLAGS"
611 clutter_save_LIBS="$LIBS"
612 LIBS="$LIBS $X11_LIBS"
615 AC_CHECK_FUNC([XGetEventData],
617 AC_DEFINE([HAVE_XGE], [1], [Define to 1 if X Generic Extensions is available])
621 CPPFLAGS="$clutter_save_CPPFLAGS"
622 LIBS="$clutter_save_LIBS"
625 AC_ARG_ENABLE([xinput],
626 [AS_HELP_STRING([--enable-xinput], [Use the XI X extension])],
630 AS_IF([test "x$enable_xinput" = "xyes"],
632 PKG_CHECK_EXISTS([xi], [have_xinput=yes], [have_xinput=no])
638 AS_CASE([$have_xinput],
642 AC_CHECK_HEADERS([X11/extensions/XInput2.h],
645 AC_DEFINE([HAVE_XINPUT_2],
647 [Define to 1 if XI2 is available])
651 AC_DEFINE([HAVE_XINPUT],
653 [Define to 1 if XInput is available])
656 X11_LIBS="$X11_LIBS $XINPUT_LIBS"
657 X11_PC_FILES="$X11_PC_FILES xi"
664 [AC_MSG_ERROR([Invalid argument for --enable-xinput])]
668 clutter_save_CPPFLAGS="$CPPFLAGS"
669 CPPFLAGS="$CPPFLAGS $X11_CFLAGS"
671 clutter_save_LIBS="$LIBS"
672 LIBS="$LIBS $X11_LIBS"
675 AC_CHECK_FUNC([XkbQueryExtension],
677 AC_DEFINE(HAVE_XKB, 1, [Define to use XKB extension])
681 CPPFLAGS="$clutter_save_CPPFLAGS"
682 LIBS="$clutter_save_LIBS"
685 BACKEND_PC_FILES="$BACKEND_PC_FILES $X11_PC_FILES"
686 FLAVOUR_LIBS="$FLAVOUR_LIBS $X11_LIBS"
687 FLAVOUR_CFLAGS="$FLAVOUR_CFLAGS $X11_CFLAGS"
691 AM_CONDITIONAL([BUILD_XI2], [test "x$have_xinput2" = "xyes"])
692 AM_CONDITIONAL(X11_TESTS, [test "x$x11_tests" = "xyes"])
694 dnl === Enable debug level ====================================================
696 m4_define([debug_default], [m4_if(m4_eval(clutter_minor_version % 2), [1], [yes], [minimum])])
697 AC_ARG_ENABLE([debug],
698 [AS_HELP_STRING([--enable-debug=@<:@no/minimum/yes@:>@],
699 [Control Clutter debugging level @<:@default=]debug_default[@:>@])],
701 [enable_debug=debug_default])
703 AS_CASE([$enable_debug],
707 test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
708 CLUTTER_DEBUG_CFLAGS="-DCLUTTER_ENABLE_DEBUG"
712 [CLUTTER_DEBUG_CFLAGS="-DCLUTTER_ENABLE_DEBUG -DG_DISABLE_CAST_CHECKS"],
715 [CLUTTER_DEBUG_CFLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"],
717 [AC_MSG_ERROR([Unknown argument for --enable-debug])]
720 AC_SUBST(CLUTTER_DEBUG_CFLAGS)
722 dnl === Enable deprecation guards ==================================================
724 m4_define([deprecated_default],
725 [m4_if(m4_eval(clutter_minor_version % 2),
730 AC_ARG_ENABLE([deprecated],
731 [AS_HELP_STRING([--enable-deprecated=@<:@no/yes@:>@],
732 [Whether deprecated symbols should be disabled when compiling Clutter @<:@default=]deprecated_default[@:>@])],
734 [enable_deprecated=deprecated_default])
736 AS_CASE([$enable_deprecated],
740 CLUTTER_DEPRECATED_CFLAGS="-DG_DISABLE_SINGLE_INCLUDES -DCOGL_DISABLE_DEPRECATED -DCLUTTER_DISABLE_DEPRECATED"
745 CLUTTER_DEPRECATED_CFLAGS="-DGLIB_DISABLE_DEPRECATION_WARNINGS -DCLUTTER_DISABLE_DEPRECATION_WARNINGS"
748 [AC_MSG_ERROR([Unknown argument for --enable-deprecated])]
751 AC_SUBST([CLUTTER_DEPRECATED_CFLAGS])
754 dnl === Conformance test suite ================================================
756 AC_ARG_ENABLE([conformance],
757 [AS_HELP_STRING([--enable-conformance=@<:@no/yes@:>@],
758 [Build conformance test suite @<:@default=yes@:>@])],
760 [enable_conformance=yes])
762 AM_CONDITIONAL([BUILD_TESTS], [test "x$enable_conformance" = "xyes"])
764 dnl === Profiling =============================================================
766 m4_define([profile_default], [no])
767 AC_ARG_ENABLE(profile,
768 AS_HELP_STRING([--enable-profile=@<:@no/yes@:>@],
769 [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@:>@]),
771 [enable_profile=profile_default])
773 AS_CASE([$enable_profile],
777 AS_IF([test "x$GCC" = "xyes"],
779 PKG_CHECK_MODULES([PROFILE_DEP], [uprof-0.3])
780 CLUTTER_PROFILE_CFLAGS="-DCLUTTER_ENABLE_PROFILE $PROFILE_DEP_CFLAGS"
781 CLUTTER_PROFILE_LDFLAGS="$PROFILE_DEP_LIBS"
783 AS_IF([test "x$enable_debug" = "xyes"], [CLUTTER_PROFILE_CFLAGS+=" -DUPROF_DEBUG"])
786 AC_MSG_ERROR([--enable-profile is currently only supported if using GCC])
792 CLUTTER_PROFILE_CFLAGS=""
793 CLUTTER_PROFILE_LDFLAGS=""
796 [*], [AC_MSG_ERROR([Invalid value for --enable-profile])]
798 AM_CONDITIONAL(PROFILE, test "x$enable_profile" != "xno")
799 AC_SUBST(CLUTTER_PROFILE_CFLAGS)
800 AC_SUBST(CLUTTER_PROFILE_LDFLAGS)
802 dnl === Coverage report =======================================================
804 AC_PATH_PROG([GCOV], [gcov], [enable_gcov=no])
806 AC_MSG_CHECKING([whether to build with gcov testing])
808 AC_ARG_ENABLE([gcov],
809 [AS_HELP_STRING([--enable-gcov],
810 [Whether to enable coverage testing (requires gcc
815 AS_IF([test "x$enable_gcov" = "xyes" && test "x$GCC" = "xyes"],
817 AS_IF([test "x$enable_conformance" = "xno"],
818 [AC_MSG_WARN([Conformance test suite is disabled, the coverage report will be incomplete])],
819 [AC_MSG_RESULT([yes])]
822 GCOV_CFLAGS="-g -O0 -fprofile-arcs -ftest-coverage"
823 GCOV_LDFLAGS="-lgcov"
825 [AC_MSG_RESULT([no])]
828 AM_CONDITIONAL([GCOV_ENABLED], [test "x$enable_gcov" = "xyes"])
829 AC_SUBST([GCOV_CFLAGS])
830 AC_SUBST([GCOV_LDFLAGS])
832 dnl === Enable strict compiler flags ==========================================
834 # use strict compiler flags only when building from git; the rules for
835 # distcheck will take care of turning this on when making a release
836 m4_define([maintainer_flags_default], [m4_if(m4_eval(clutter_micro_version % 2), [1], [yes], [no])])
837 AC_ARG_ENABLE([maintainer-flags],
838 [AS_HELP_STRING([--enable-maintainer-flags=@<:@no/yes/error@:>@],
839 [Use strict compiler flags @<:@default=]maintainer_flags_default[@:>@])],
841 [enable_maintainer_flags=maintainer_flags_default])
843 MAINTAINER_COMPILER_FLAGS="-Wall -Wshadow -Wcast-align -Wuninitialized
844 -Wno-strict-aliasing -Wempty-body -Wformat
845 -Wformat-security -Winit-self
846 -Wdeclaration-after-statement -Wvla
849 AS_CASE([$enable_maintainer_flags],
852 AS_COMPILER_FLAGS([MAINTAINER_CFLAGS], [$MAINTAINER_COMPILER_FLAGS])
861 MAINTAINER_COMPILER_FLAGS="$MAINTAINER_COMPILER_FLAGS -Werror"
862 AS_COMPILER_FLAGS([MAINTAINER_CFLAGS], [$MAINTAINER_COMPILER_FLAGS])
866 [AC_MSG_ERROR([Invalid option for --enable-maintainer-flags])]
869 # strip leading spaces
870 MAINTAINER_CFLAGS=${MAINTAINER_CFLAGS#* }
871 AC_SUBST(MAINTAINER_CFLAGS)
873 dnl === Dependencies, compiler flags and linker libraries =====================
874 # strip leading space
875 BACKEND_PC_FILES=${BACKEND_PC_FILES#* }
877 CLUTTER_REQUIRES="$CLUTTER_BASE_PC_FILES $IMAGE_PC_FILES $BACKEND_PC_FILES"
878 PKG_CHECK_MODULES(CLUTTER_DEPS, [$CLUTTER_REQUIRES])
879 AC_SUBST(CLUTTER_REQUIRES)
881 CLUTTER_CFLAGS="$FLAVOUR_CFLAGS $CLUTTER_DEPS_CFLAGS $CLUTTER_PROFILE_CFLAGS $GLIB_CFLAGS"
882 CLUTTER_LIBS="$FLAVOUR_LIBS $CLUTTER_DEPS_LIBS $CLUTTER_PROFILE_LDFLAGS $GLIB_LIBS"
883 AC_SUBST(CLUTTER_CFLAGS)
884 AC_SUBST(CLUTTER_LIBS)
887 dnl === GObject-Introspection check ===========================================
889 GOBJECT_INTROSPECTION_CHECK([gi_req_version])
891 dnl === GTK Doc check =========================================================
893 GTK_DOC_CHECK([gtk_doc_req_version], [--flavour no-tmpl])
895 # we don't want to build the documentation from a Git clone unless we
896 # explicitly tell configure to do so; this allows avoiding to recurse into
897 # the documentation directory when building Clutter inside Poky for a
898 # target device that doesn't have gtk-doc installed. for reference
899 # see: http://bugzilla.openedhand.com/show_bug.cgi?id=1047
901 # we use autogen.sh as it exists only inside the Git clones, and it
902 # is not packaged into tarballs.
903 AM_CONDITIONAL([BUILD_GTK_DOC], [test "x$enable_gtk_doc" = "xyes" || test ! -f "autogen.sh"])
905 # prefixes for fixing gtk-doc references
906 CAIRO_PREFIX="`$PKG_CONFIG --variable=prefix cairo`"
907 GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
908 PANGO_PREFIX="`$PKG_CONFIG --variable=prefix pango`"
909 COGL_PREFIX="`$PKG_CONFIG --variable=prefix cogl-1.0`"
910 ATK_PREFIX="`$PKG_CONFIG --variable=prefix atk`"
911 AC_SUBST(CAIRO_PREFIX)
912 AC_SUBST(GLIB_PREFIX)
913 AC_SUBST(PANGO_PREFIX)
914 AC_SUBST(COGL_PREFIX)
917 dnl === Manual ================================================================
919 AC_ARG_ENABLE([docs],
920 [AS_HELP_STRING([--enable-docs=@<:@no/yes@:>@],
921 [Build optional documentation; requires xsltproc and jw.])],
922 [enable_docs=$enableval],
926 AS_IF([test "x$enable_docs" = "xyes"],
928 AC_PATH_PROG(JW, [jw], [no])
929 AS_IF([test "x$JW" = "xno"],
931 AC_MSG_WARN([jw not found; pdf generation has been disabled])
935 AC_PATH_PROG(XSLTPROC, [xsltproc], [no])
936 AS_IF([test "x$XSLTPROC" = "xno"],
938 AC_MSG_ERROR([xsltproc not found])
943 AM_CONDITIONAL(ENABLE_DOCS, [test "x$enable_docs" = "xyes"])
944 AM_CONDITIONAL(ENABLE_PDFS, [test "x$enable_pdfs" = "xyes"])
946 dnl === I18N ==================================================================
948 AM_GNU_GETTEXT_VERSION([0.17])
949 AM_GNU_GETTEXT([external])
951 GETTEXT_PACKAGE="clutter-1.0"
952 AC_SUBST(GETTEXT_PACKAGE)
953 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],
954 ["$GETTEXT_PACKAGE"],
955 [The prefix for our gettext translation domains.])
958 dnl ===========================================================================
966 build/autotools/Makefile
970 clutter/clutter-config.h
971 clutter/clutter-version.h
972 clutter/clutter-$CLUTTER_API_VERSION.pc:clutter/clutter.pc.in
974 clutter/cally/cally-$CLUTTER_API_VERSION.pc:clutter/cally/cally.pc.in
976 clutter/cogl/clutter-cex100.h
979 tests/accessibility/Makefile
980 tests/conform/Makefile
981 tests/conform/test-launcher.sh
983 tests/interactive/Makefile
984 tests/interactive/wrapper.sh
985 tests/micro-bench/Makefile
986 tests/performance/Makefile
989 doc/reference/Makefile
990 doc/reference/clutter/Makefile
991 doc/reference/clutter/clutter-docs.xml
992 doc/reference/cally/Makefile
993 doc/reference/cally/cally-docs.xml
995 doc/cookbook/Makefile
996 doc/cookbook/clutter-cookbook.xml
997 doc/cookbook/examples/Makefile
1004 dnl === Summary ===============================================================
1007 echo "Clutter - $VERSION (${CLUTTER_RELEASE_STATUS})"
1012 echo " Prefix: ${prefix}"
1013 echo " Libdir: ${libdir}"
1014 echo " Sysconfdir: ${sysconfdir}"
1015 echo " Flavour: ${CLUTTER_WINSYS}"
1016 echo " Target library: ${CLUTTER_WINSYS_LIB}"
1018 # Compiler/Debug related flags
1020 echo " • Compiler options:"
1021 echo " Clutter debug level: ${enable_debug}"
1022 echo " Compiler flags: ${CFLAGS} ${MAINTAINER_CFLAGS}"
1023 echo " Profiling enabled: ${enable_profile}"
1024 echo " Enable coverage tests: ${enable_gcov}"
1025 echo " Enable deprecated symbols: ${enable_deprecated}"
1029 echo " • Documentation:"
1030 echo " Build API Reference: ${enable_gtk_doc}"
1031 echo " Build Additional Documentation: ${enable_docs} (Generate PDF: ${enable_pdfs})"
1036 echo " Build introspection data: ${enable_introspection}"
1037 echo " Build conformance test suite: ${enable_conformance}"
1039 # Clutter backend related flags
1041 echo " • Clutter Backend:"
1043 if test "x$experimental_backend" = "xno"; then
1044 echo " Windowing system: ${CLUTTER_WINSYS}"
1046 echo " Windowing system: ${CLUTTER_WINSYS} (WARNING: Experimental)"
1049 if test "x$SUPPORT_XLIB" = "x1"; then
1050 echo " Enable XComposite: ${have_xcomposite}"
1051 echo " Enable XInput: ${have_xinput}"
1052 echo " Enable Xge: ${have_xge}"
1053 echo " Enable XI2: ${have_xinput2}"
1054 echo " Enable XKB: ${have_xkb}"
1055 echo " Enable X11 tests: ${x11_tests}"
1060 # General warning about experimental features
1061 if test "x$experimental_backend" = "xyes"; then
1063 echo "☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠"
1066 echo " The stability of your build might be affected by one or more"
1067 echo " experimental backends or experimental and unsupported features"
1068 echo "☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠"