keysyms-update: Add deprecation guards to the deprecated header
[profile/ivi/clutter.git] / configure.ac
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
4 #
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
8 # After the release:
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], [11])
13 m4_define([clutter_micro_version], [5])
14
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:
18 #
19 #  (<minor> * 100 + <micro>) - <interface_age>
20 #
21 # this allows using the same soname for different micro-releases in case
22 # no API was added or deprecated. for instance:
23 #
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
31 #   ...
32 #
33 # • for development releases: keep clutter_interface_age to 0
34 m4_define([clutter_interface_age], [0])
35
36 m4_define([clutter_binary_age], [m4_eval(100 * clutter_minor_version + clutter_micro_version)])
37
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],
41                                                                  [release])])])
42
43 m4_define([clutter_version], [clutter_major_version.clutter_minor_version.clutter_micro_version])
44
45 # change this only when breaking the API
46 m4_define([clutter_api_version], [1.0])
47
48 AC_PREREQ([2.63])
49
50 AC_INIT([clutter],
51         [clutter_version],
52         [http://bugzilla.gnome.org/enter_bug.cgi?product=clutter],
53         [clutter],
54         [http://www.clutter-project.org])
55
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])
60
61 AM_INIT_AUTOMAKE([1.11 foreign -Wno-portability no-define no-dist-gzip dist-xz tar-ustar])
62 AM_SILENT_RULES([yes])
63
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])
71
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
77 CLUTTER_LT_AGE=lt_age
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])
83
84 AC_PROG_SED
85
86 dnl = Preliminary platform checks =============================================
87
88 AC_CANONICAL_HOST
89
90 platform_win32=no
91 platform_quartz=no
92 platform_linux=no
93
94 AC_MSG_CHECKING([if building for some Win32 platform])
95 AS_CASE([$host],
96         [*-*-mingw*|*-*-cygwin*],
97         [
98           CLUTTER_LT_LDFLAGS="$CLUTTER_LT_LDFLAGS -no-undefined"
99           platform_win32=yes
100         ],
101
102         [*-*-linux*],
103         [
104           platform_linux=yes
105         ],
106
107         []
108 )
109 AC_MSG_RESULT([$platform_win32])
110
111 AM_CONDITIONAL(OS_WIN32, [test "$platform_win32" = "yes"])
112
113 AC_CHECK_HEADER([OpenGL/gl.h], [platform_quartz=yes], [platform_quartz=no])
114 AM_CONDITIONAL(OS_QUARTZ, [test "$platform_quartz" = "yes"])
115
116 AC_CHECK_HEADER([GL/glx.h], [platform_glx=yes], [platform_glx=no])
117 AC_CHECK_LIB([GL], [glXCreateContext], [platform_glx=yes], [platform_glx=no])
118 AM_CONDITIONAL(OS_GLX, [test "$platform_glx" = "yes"])
119 AM_CONDITIONAL(OS_LINUX, [test "$platform_linux" = "yes"])
120
121 AC_SUBST(CLUTTER_LT_LDFLAGS)
122
123 AC_CACHE_SAVE
124
125 dnl = Dependencies =========================================================
126
127 # Checks for programs.
128 AM_PROG_CC_C_O
129
130 # require libtool >= 2.2
131 LT_PREREQ([2.2.6])
132 LT_INIT([disable-static])
133
134 # Checks for header files.
135 AC_HEADER_STDC
136
137 # required versions for dependencies
138 m4_define([glib_req_version],           [2.31.19])
139 m4_define([cogl_req_version],           [1.9.6])
140 m4_define([json_glib_req_version],      [0.12.0])
141 m4_define([atk_req_version],            [2.1.5])
142 m4_define([cairo_req_version],          [1.10])
143 m4_define([pango_req_version],          [1.30])
144 m4_define([gi_req_version],             [0.9.5])
145 m4_define([uprof_req_version],          [0.3])
146 m4_define([gtk_doc_req_version],        [1.15])
147 m4_define([xfixes_req_version],         [3])
148 m4_define([xcomposite_req_version],     [0.4])
149 m4_define([gdk_req_version],            [3.3.18])
150
151 AC_SUBST([GLIB_REQ_VERSION],       [glib_req_version])
152 AC_SUBST([COGL_REQ_VERSION],       [cogl_req_version])
153 AC_SUBST([JSON_GLIB_REQ_VERSION],  [json_glib_req_version])
154 AC_SUBST([ATK_REQ_VERSION],        [atk_req_version])
155 AC_SUBST([CAIRO_REQ_VERSION],      [cairo_req_version])
156 AC_SUBST([PANGO_REQ_VERSION],      [pango_req_version])
157 AC_SUBST([GI_REQ_VERSION],         [gi_req_version])
158 AC_SUBST([UPROF_REQ_VERSION],      [uprof_req_version])
159 AC_SUBST([GTK_DOC_REQ_VERSION],    [gtk_doc_req_version])
160 AC_SUBST([XFIXES_REQ_VERSION],     [xfixes_req_version])
161 AC_SUBST([XCOMPOSITE_REQ_VERSION], [xcomposite_req_version])
162 AC_SUBST([GDK_REQ_VERSION],        [gdk_req_version])
163
164 # Checks for typedefs, structures, and compiler characteristics.
165 AM_PATH_GLIB_2_0([glib_req_version],
166                  [],
167                  [AC_MSG_ERROR([glib-2.0 is required])],
168                  [gobject gthread gmodule-no-export])
169
170 # Check for -Bsymbolic-functions to avoid intra-library PLT jumps
171 AC_ARG_ENABLE([Bsymbolic],
172               [AS_HELP_STRING([--disable-Bsymbolic],
173                               [Avoid linking with -Bsymbolic])],
174               [],
175               [
176                 saved_LDFLAGS="${LDFLAGS}"
177                 AC_MSG_CHECKING([for -Bsymbolic-functions linker flag])
178                 LDFLAGS=-Wl,-Bsymbolic-functions
179                 AC_TRY_LINK([], [int main (void) { return 0; }],
180                             [
181                               AC_MSG_RESULT([yes])
182                               enable_Bsymbolic=yes
183                             ],
184                             [
185                               AC_MSG_RESULT([no])
186                               enable_Bsymbolic=no
187                             ])
188                 LDFLAGS="${saved_LDFLAGS}"
189               ])
190
191 AS_IF([test "x$enable_Bsymbolic" = "xyes"], [CLUTTER_LINK_FLAGS=-Wl[,]-Bsymbolic-functions])
192 AC_SUBST(CLUTTER_LINK_FLAGS)
193
194 AC_CACHE_SAVE
195
196 dnl ========================================================================
197
198 FLAVOUR_LIBS=""
199 FLAVOUR_CFLAGS=""
200 CLUTTER_BACKENDS=""
201 CLUTTER_INPUT_BACKENDS=""
202 CLUTTER_CONFIG_DEFINES=
203
204 experimental_backend=no
205 experimental_input_backend=no
206
207 # base dependencies for core
208 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"
209
210 # private base dependencies
211 CLUTTER_BASE_PC_FILES_PRIVATE=""
212
213 # backend specific pkg-config files
214 BACKEND_PC_FILES=""
215
216 # private backend specific dependencies
217 BACKEND_PC_FILES_PRIVATE=""
218
219 dnl === Clutter windowing system backend ======================================
220
221 AC_ARG_ENABLE([x11-backend],
222               [AS_HELP_STRING([--enable-x11-backend=@<:@yes/no@:>@], [Enable the X11 backend (default=check)])],
223               [enable_x11=$enableval],
224               [enable_x11=check])
225 AC_ARG_ENABLE([win32-backend],
226               [AS_HELP_STRING([--enable-win32-backend=@<:@yes/no@:>@], [Enable the Windows backend (default=check)])],
227               [enable_win32=$enableval],
228               [enable_win32=check])
229 AC_ARG_ENABLE([quartz-backend],
230               [AS_HELP_STRING([--enable-quartz-backend=@<:@yes/no@:>@], [Enable the OS X backend (default=check)])],
231               [enable_osx=$enableval],
232               [enable_osx=check])
233 AC_ARG_ENABLE([gdk-backend],
234               [AS_HELP_STRING([--enable-gdk-backend=@<:@yes/no@:>@], [Enable the GDK backend (default=check)])],
235               [enable_gdk=$enableval],
236               [enable_gdk=check])
237 AC_ARG_ENABLE([wayland-backend],
238               [AS_HELP_STRING([--enable-wayland-backend=@<:@yes/no@:>@], [Enable the Wayland client backend (default=no)])],
239               [enable_wayland=$enableval],
240               [enable_wayland=no])
241 AC_ARG_ENABLE([egl-backend],
242               [AS_HELP_STRING([--enable-egl-backend=@<:@yes/no@:>@], [Enable the EGL framebuffer backend (default=no)])],
243               [enable_egl=$enableval],
244               [enable_egl=no])
245 AC_ARG_ENABLE([cex100-backend],
246               [AS_HELP_STRING([--enable-cex100-backend=@<:@yes/no@:>@], [Enable the CEx100 backend (default=no)])],
247               [enable_cex100=$enableval],
248               [enable_cex100=no])
249
250 dnl Define default values
251 AS_IF([test "x$enable_x11" = "xcheck"],
252       [
253         AS_IF([test "x$platform_glx" = "xyes"], [enable_x11=yes], [enable_x11=no])
254       ])
255
256 AS_IF([test "x$enable_win32" = "xcheck"],
257       [
258         AS_IF([test "x$platform_win32" = "xyes"], [enable_win32=yes], [enable_win32=no])
259       ])
260
261 AS_IF([test "x$enable_osx" = "xcheck"],
262       [
263         AS_IF([test "x$platform_quartz" = "xyes"], [enable_osx=yes], [enable_osx=no])
264       ])
265
266 AS_IF([test "x$enable_gdk" = "xcheck"],
267       [
268         PKG_CHECK_EXISTS([gdk-3.0 >= gdk_req_version], [enable_gdk=yes], [enable_gdk=no])
269       ])
270
271 dnl Per-backend rules
272 AS_IF([test "x$enable_x11" = "xyes"],
273       [
274         CLUTTER_BACKENDS="$CLUTTER_BACKENDS x11"
275         CLUTTER_INPUT_BACKENDS="$CLUTTER_INPUT_BACKENDS x11"
276
277         SUPPORT_X11=1
278         SUPPORT_GLX=1
279         SUPPORT_COGL=1
280
281         # we use fontconfig API and pango-ft2 when the fontconfig
282         # configuration changes; we don't expose any API for this
283         # so we add pango-ft2 to the private Requires.
284         PKG_CHECK_EXISTS([pangoft2],
285                          [
286                            AC_DEFINE([HAVE_PANGO_FT2], [1], [Supports PangoFt2])
287                            BACKEND_PC_FILES_PRIVATE="$BACKEND_PC_FILES_PRIVATE pangoft2"
288                          ],
289                          [])
290
291         AC_DEFINE([HAVE_CLUTTER_GLX], [1], [Have the GLX backend])
292       ])
293
294 AS_IF([test "x$enable_gdk" = "xyes"],
295       [
296         CLUTTER_BACKENDS="$CLUTTER_BACKENDS gdk"
297         CLUTTER_INPUT_BACKENDS="$CLUTTER_INPUT_BACKENDS gdk"
298
299         SUPPORT_GDK=1
300         SUPPORT_COGL=1
301
302         BACKEND_PC_FILES="$BACKEND_PC_FILES gdk-3.0"
303       ])
304
305 AS_IF([test "x$enable_wayland" = "xyes"],
306       [
307         CLUTTER_BACKENDS="$CLUTTER_BACKENDS wayland"
308         CLUTTER_INPUT_BACKENDS="$CLUTTER_INPUT_BACKENDS wayland"
309
310         experimental_backend="yes"
311
312         SUPPORT_WAYLAND=1
313
314         PKG_CHECK_EXISTS([wayland-client xkbcommon gdk-pixbuf-2.0],
315                          [
316                             BACKEND_PC_FILES="$BACKEND_PC_FILES wayland-client xkbcommon"
317                             BACKEND_PC_FILES_PRIVATE="$BACKEND_PC_FILES_PRIVATE gdk-pixbuf-2.0"
318                          ],
319                          [])
320
321         AC_DEFINE([HAVE_CLUTTER_WAYLAND], [1], [Have the Wayland client backend])
322       ])
323
324 dnl Note this is orthogonal to the client side support and you can
325 dnl use the Wayland compositor features with any of the clutter
326 dnl backends with corresponding Cogl support.
327 AC_ARG_ENABLE([wayland-compositor],
328               [AS_HELP_STRING([--enable-wayland-compositor=@<:@yes/no@:>@],
329                               [Enable Wayland compositor features (default=no)])],
330               [],
331               [AS_IF([test "x$SUPPORT_EGL" = "x1"],
332                      [enable_wayland_compositor=yes],
333                      [enable_wayland_compositor=no])
334               ])
335
336 AS_IF([test "x$enable_wayland_compositor" = "xyes"],
337       [
338         PKG_CHECK_EXISTS([wayland-server],
339                          [BACKEND_PC_FILES="$BACKEND_PC_FILES wayland-server"], [])
340         SUPPORT_WAYLAND_COMPOSITOR=1
341         CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
342 #define CLUTTER_HAS_WAYLAND_COMPOSITOR_SUPPORT 1"
343         AC_DEFINE([HAVE_CLUTTER_WAYLAND_COMPOSITOR], [1], [Have Wayland compositor support])
344       ])
345
346 AM_CONDITIONAL(SUPPORT_WAYLAND_COMPOSITOR, [test "x$SUPPORT_WAYLAND_COMPOSITOR" = "x1"])
347
348 AS_IF([test "x$enable_wayland_compositor" != "xyes" -a "x$enable_wayland" != "xyes"],
349       [
350         # The wayland headers introduce so much symbol shadowing that build
351         # logs become incomprehensible with -Wshadow so we only use it for
352         # non-wayland builds.
353         MAINTAINER_COMPILER_FLAGS="-Wshadow"
354       ])
355
356 AS_IF([test "x$enable_cex100" = "xyes"],
357       [
358         CLUTTER_BACKENDS="$CLUTTER_BACKENDS cex100"
359
360         experimental_backend="yes"
361
362         SUPPORT_COGL=1
363         SUPPORT_CEX100=1
364
365         have_gdl=no
366         AC_CHECK_HEADERS([libgdl.h], [have_gdl=yes])
367
368         AS_IF([test "x$have_gdl" = "xno"],
369               [
370                 AC_CHECK_HEADERS([CE4100/libgdl.h],
371                                  [
372                                    FLAVOUR_CFLAGS="-I/usr/include/CE4100"
373                                    have_gdl=yes
374                                    CLUTTER_CEX100_LIBGDL_PREFIX=CE4100/
375                                  ])
376               ])
377
378         AS_IF([test "x$have_gdl" = "xno"],
379               [AC_MSG_ERROR([libgdl.h not found but the CEx100 backend has been explicitly enabled])])
380
381         AC_SUBST(CLUTTER_CEX100_LIBGDL_PREFIX)
382
383         FLAVOUR_LIBS="$FLAVOUR_LIBS -lgdl"
384
385         AC_DEFINE([CLUTTER_EGL_BACKEND_CEX100], [1], [Use CEX100 EGL backend])
386         AC_DEFINE([CLUTTER_EGL_BACKEND_GENERIC], [1], [Use Generic EGL backend])
387         AC_DEFINE([HAVE_CLUTTER_EGL], [1], [Have the EGL backend])
388       ])
389
390 AS_IF([test "x$enable_egl" = "xyes"],
391       [
392         CLUTTER_BACKENDS="$CLUTTER_BACKENDS egl"
393
394         experimental_backend="yes"
395
396         SUPPORT_EGL=1
397         SUPPORT_COGL=1
398
399         FLAVOUR_LIBS="$FLAVOUR_LIBS $TSLIB_LIBS $EVDEV_LIBS"
400         FLAVOUR_CFLAGS="$FLAVOUR_CFLAGS $TSLIB_CFLAGS $EVDEV_CFLAGS"
401
402         AC_DEFINE([CLUTTER_EGL_BACKEND_GENERIC], [1], [Use Generic EGL backend])
403
404         AC_DEFINE([HAVE_CLUTTER_EGL], [1], [Have the EGL backend])
405       ])
406
407 AS_IF([test "x$enable_osx" = "xyes"],
408       [
409         CLUTTER_BACKENDS="$CLUTTER_BACKENDS osx"
410         CLUTTER_INPUT_BACKENDS="$CLUTTER_INPUT_BACKENDS osx"
411
412         AC_DEFINE([HAVE_CLUTTER_OSX], [1], [Have the OSX backend])
413
414         FLAVOUR_LIBS="$FLAVOUR_LIBS -framework Cocoa -framework OpenGL"
415
416         SUPPORT_OSX=1
417       ])
418
419 AS_IF([test "x$enable_win32" = "xyes"],
420       [
421         CLUTTER_BACKENDS="$CLUTTER_BACKENDS win32"
422         CLUTTER_INPUT_BACKENDS="$CLUTTER_INPUT_BACKENDS win32"
423
424         AC_DEFINE([HAVE_CLUTTER_WIN32], [1], [Have the Win32 backend])
425
426         FLAVOUR_LIBS="$FLAVOUR_LIBS -lopengl32 -lgdi32 -lwinmm"
427         FLAVOUR_CFLAGS="$FLAVOUR_CFLAGS -D_WIN32_WINNT=0x0500"
428
429         AC_CHECK_TOOL(WINDRES, [windres], [AC_MSG_ERROR([*** windres is required])])
430
431         SUPPORT_WIN32=1
432       ])
433
434 AS_IF([test "x$CLUTTER_BACKENDS" = "x"],
435       [
436         AC_MSG_ERROR([No backend enabled. You need to enable at least one backend.])
437       ])
438
439 AS_IF([test "x$platform_linux" = "xyes"],
440       [
441         AC_DEFINE([OS_LINUX], [1], [Define to 1 if building for Linux])
442       ])
443
444 # additional input backends
445
446 AC_ARG_ENABLE([tslib-input],
447               [AS_HELP_STRING([--enable-tslib-input=@<:@yes/no@:>@], [Enable TSLib for input events (default=no)])],
448               [enable_tslib=$enableval],
449               [enable_tslib=no])
450 AC_ARG_ENABLE([evdev-input],
451               [AS_HELP_STRING([--enable-evdev-input=@<:@yes/no@:>@], [Enable evdev for input events (default=no)])],
452               [enable_evdev=$enableval],
453               [enable_evdev=no])
454
455 AS_IF([test "x$enable_tslib" = "xyes"],
456       [
457         PKG_CHECK_MODULES(TSLIB, [tslib-1.0], [have_tslib=yes], [have_tslib=no])
458         AS_IF([test "x$have_tslib" = "xyes"],
459               [
460                 CLUTTER_INPUT_BACKENDS="$CLUTTER_INPUT_BACKENDS tslib"
461                 experimental_input_backend="yes"
462                 AC_DEFINE([HAVE_TSLIB], [1], [Have tslib for touchscreen handling])
463                 SUPPORT_TSLIB=1
464               ])
465       ])
466
467 AS_IF([test "x$enable_evdev" = "xyes"],
468       [
469         PKG_CHECK_MODULES(EVDEV, [gudev-1.0 xkbcommon], [have_evdev=yes], [have_evdev=no])
470         AS_IF([test "x$have_evdev" = "xyes"],
471               [
472                 CLUTTER_INPUT_BACKENDS="$CLUTTER_INPUT_BACKENDS evdev"
473                 BACKEND_PC_FILES="$BACKEND_PC_FILES gudev-1.0 xkbcommon"
474                 experimental_input_backend="yes"
475                 AC_DEFINE([HAVE_EVDEV], [1], [Have evdev support for input handling])
476                 SUPPORT_EVDEV=1
477               ])
478       ])
479
480 # conditionals for use in automake files...
481 AM_CONDITIONAL(SUPPORT_GLX,     [test "x$SUPPORT_GLX" = "x1"])
482 AM_CONDITIONAL(SUPPORT_X11,     [test "x$SUPPORT_X11" = "x1"])
483 AM_CONDITIONAL(SUPPORT_GDK,     [test "x$SUPPORT_GDK" = "x1"])
484 AM_CONDITIONAL(SUPPORT_EGL,     [test "x$SUPPORT_EGL" = "x1"])
485 AM_CONDITIONAL(SUPPORT_OSX,     [test "x$SUPPORT_OSX" = "x1"])
486 AM_CONDITIONAL(SUPPORT_WIN32,   [test "x$SUPPORT_WIN32" = "x1"])
487 AM_CONDITIONAL(SUPPORT_CEX100,  [test "x$SUPPORT_CEX100" = "x1"])
488 AM_CONDITIONAL(SUPPORT_WAYLAND, [test "x$SUPPORT_WAYLAND" = "x1"])
489
490 AM_CONDITIONAL(USE_COGL,  [test "x$SUPPORT_COGL" = "x1"])
491 AM_CONDITIONAL(USE_TSLIB, [test "x$have_tslib" = "xyes"])
492 AM_CONDITIONAL(USE_EVDEV, [test "x$have_evdev" = "xyes"])
493 AM_CONDITIONAL(USE_GLD,   [test "x$have_gdl" = "xyes"])
494
495 AM_CONDITIONAL(NEED_XKB_UTILS, [test "x$have_evdev" = "xyes" -o "x$SUPPORT_WAYLAND" = "x1"])
496
497 dnl Instead of using AM_CFLAGS to ensure
498 dnl COGL_ENABLE_EXPERIMENTAL_2_0_API is defined while compiling clutter
499 dnl and cogl code we use a define in config.h instead. This helps ensure
500 dnl other tools such as glib-mkenums and gir-scanner don't end up
501 dnl using the define also.
502 AC_DEFINE([COGL_ENABLE_EXPERIMENTAL_2_0_API], [1], [Can use Cogl 2.0 API internally])
503
504 dnl strip leading spaces
505 CLUTTER_BACKENDS=${CLUTTER_BACKENDS#* }
506 AC_SUBST(CLUTTER_BACKENDS)
507
508 CLUTTER_INPUT_BACKENDS=${CLUTTER_INPUT_BACKENDS#* }
509 AC_SUBST(CLUTTER_INPUT_BACKENDS)
510
511 AC_CACHE_SAVE
512
513 dnl === Clutter configuration =================================================
514
515 # windowing systems
516 AS_IF([test "x$SUPPORT_X11" = "x1"],
517       [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
518 #define CLUTTER_WINDOWING_X11 \"x11\"
519 #define CLUTTER_INPUT_X11 \"x11\""])
520 AS_IF([test "x$SUPPORT_GDK" = "x1"],
521       [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
522 #define CLUTTER_WINDOWING_GDK \"gdk\"
523 #define CLUTTER_INPUT_GDK \"gdk\""])
524 AS_IF([test "x$SUPPORT_GLX" = "x1"],
525       [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
526 #define CLUTTER_WINDOWING_GLX \"glx\""])
527 AS_IF([test "x$SUPPORT_EGL" = "x1"],
528       [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
529 #define CLUTTER_WINDOWING_EGL \"eglnative\""])
530 AS_IF([test "x$SUPPORT_WAYLAND" = "x1"],
531       [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
532 #define CLUTTER_WINDOWING_WAYLAND \"wayland\""])
533 AS_IF([test "x$SUPPORT_OSX" = "x1"],
534       [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
535 #define CLUTTER_WINDOWING_OSX \"osx\"
536 #define CLUTTER_INPUT_OSX \"osx\""])
537 AS_IF([test "x$SUPPORT_WIN32" = "x1"],
538       [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
539 #define CLUTTER_WINDOWING_WIN32 \"win32\"
540 #define CLUTTER_INPUT_WIN32 \"win32\""])
541 AS_IF([test "x$SUPPORT_CEX100" = "x1"],
542       [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
543 #define CLUTTER_WINDOWING_CEX100 \"cex100\""])
544 AS_IF([test "x$SUPPORT_EVDEV" = "x1"],
545       [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
546 #define CLUTTER_INPUT_EVDEV \"evdev\""])
547 AS_IF([test "x$SUPPORT_TSLIB" = "x1"],
548       [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
549 #define CLUTTER_INPUT_TSLIB \"tslib\""])
550 AS_IF([test "x$SUPPORT_WAYLAND" = "x1"],
551       [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
552 #define CLUTTER_INPUT_WAYLAND \"wayland\""])
553
554 # the 'null' input backend is special
555 CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
556 #define CLUTTER_INPUT_NULL \"null\""
557
558 AC_SUBST([CLUTTER_CONFIG_DEFINES])
559
560 dnl === Clutter substitutions kept for backwards compatibility ================
561 AC_SUBST([CLUTTER_WINSYS],       [deprecated])
562 AC_SUBST([CLUTTER_WINSYS_BASE],  [deprecated])
563 AC_SUBST([CLUTTER_STAGE_TYPE],   [deprecated])
564 AC_SUBST([CLUTTER_SONAME_INFIX], [deprecated])
565 AC_SUBST([CLUTTER_FLAVOUR],      [deprecated])
566 AC_SUBST([CLUTTER_COGL],         [deprecated])
567 AC_SUBST([COGL_DRIVER],          [deprecated])
568
569 dnl === X11 checks, only for X11-based backends ===============================
570 X11_PC_FILES=""
571 X11_EXTS=""
572 x11_tests=no
573
574 AS_IF([test "x$SUPPORT_X11" = "x1"],
575       [
576         # base X11 includes and libraries
577         AC_MSG_CHECKING([for X11])
578
579         # start with pkg-config
580         PKG_CHECK_EXISTS([x11], [have_x11=yes], [have_x11=no])
581         AS_IF([test "x$have_x11" = "xyes"],
582               [
583                 X11_PC_FILES="x11"
584
585                 # we actually need to ask for CFLAGS and LIBS
586                 X11_CFLAGS=`$PKG_CONFIG --cflags $X11_PC_FILES`
587                 X11_LIBS=`$PKG_CONFIG --libs $X11_PC_FILES`
588
589                 AC_MSG_RESULT([found])
590               ],
591               [
592                 # no pkg-config, let's go old school
593                 AC_PATH_X
594
595                 AS_IF([test "x$no_x" = "xyes"],
596                       [AC_MSG_ERROR([No X11 Libraries found])],
597                       [
598                         AS_IF([test "x$x_includes" != "xNONE" && test -n "$x_includes"],
599                               [X11_CFLAGS=-I`echo $x_includes | sed -e "s/:/ -I/g"`])
600
601                         AS_IF([test "x$x_libraries" != "xNONE" && test -n "$x_libraries"],
602                               [X11_LIBS=-L`echo $x_libraries | sed -e "s/:/ -L/g"`])
603
604                         AC_MSG_RESULT([found])
605                       ]
606                 )
607               ]
608         )
609
610         # XEXT (required)
611         AC_MSG_CHECKING([for XEXT extension])
612         PKG_CHECK_EXISTS([xext], [have_xext=yes], [have_xext=no])
613         AS_IF([test "x$have_xext" = "xyes"],
614               [
615                 AC_DEFINE(HAVE_XEXT, [1], [Define to 1 if we have the XEXT X extension])
616
617                 X11_LIBS="$X11_LIBS -lXext"
618                 X11_PC_FILES="$X11_PC_FILES xext"
619                 X11_EXTS="$X11_EXTS xext"
620
621                 AC_MSG_RESULT([found])
622               ],
623               [AC_MSG_ERROR([Not found])]
624         )
625
626         # XFIXES (required)
627         AC_MSG_CHECKING([for XFIXES extension >= $XFIXES_REQ_VERSION])
628         PKG_CHECK_EXISTS([xfixes >= $XFIXES_REQ_VERSION], [have_xfixes=yes], [have_xfixes=no])
629         AS_IF([test "x$have_xfixes" = "xyes"],
630               [
631                 AC_DEFINE(HAVE_XFIXES, [1], [Define to 1 if we have the XFIXES X extension])
632
633                 X11_LIBS="$X11_LIBS -lXfixes"
634                 X11_PC_FILES="$X11_PC_FILES xfixes >= $XFIXES_REQ_VERSION"
635                 X11_EXTS="$X11_EXTS xfixes"
636
637                 AC_MSG_RESULT([found])
638               ],
639               [AC_MSG_ERROR([Not found])]
640         )
641
642         # XDAMAGE (required)
643         AC_MSG_CHECKING([for XDAMAGE extension])
644         PKG_CHECK_EXISTS([xdamage], [have_xdamage=yes], [have_xdamage=no])
645         AS_IF([test "x$have_xdamage" = "xyes"],
646               [
647                 AC_DEFINE(HAVE_XDAMAGE, [1], [Define to 1 if we have the XDAMAGE X extension])
648
649                 X11_LIBS="$X11_LIBS -lXdamage"
650                 X11_PC_FILES="$X11_PC_FILES xdamage"
651                 X11_EXTS="$X11_EXTS xdamage"
652
653                 AC_MSG_RESULT([found])
654               ],
655               [AC_MSG_ERROR([not found])]
656         )
657
658         # XCOMPOSITE (optional)
659         AC_MSG_CHECKING([for XCOMPOSITE extension >= $XCOMPOSITE_REQ_VERSION])
660         PKG_CHECK_EXISTS([xcomposite >= $XCOMPOSITE_REQ_VERSION], [have_xcomposite=yes], [have_xcomposite=no])
661         AS_IF([test "x$have_xcomposite" = "xyes"],
662               [
663                 AC_DEFINE(HAVE_XCOMPOSITE, [1], [Define to 1 if we have the XCOMPOSITE X extension])
664
665                 X11_LIBS="$X11_LIBS -lXcomposite"
666                 X11_PC_FILES="$X11_PC_FILES xcomposite >= $XCOMPOSITE_REQ_VERSION"
667                 X11_EXTS="$X11_EXTS xcomposite"
668
669                 AC_MSG_RESULT([found])
670               ],
671               [AC_MSG_ERROR([not found])]
672         )
673
674         # X Generic Extensions (optional)
675         clutter_save_CPPFLAGS="$CPPFLAGS"
676         CPPFLAGS="$CPPFLAGS $X11_CFLAGS"
677
678         clutter_save_LIBS="$LIBS"
679         LIBS="$LIBS $X11_LIBS"
680
681         have_xge=no
682         AC_CHECK_FUNC([XGetEventData],
683                       [
684                         AC_DEFINE([HAVE_XGE], [1], [Define to 1 if X Generic Extensions is available])
685                         have_xge=yes
686                         X11_EXTS="$X11_EXTS xge"
687                       ])
688
689         CPPFLAGS="$clutter_save_CPPFLAGS"
690         LIBS="$clutter_save_LIBS"
691
692         # XI (optional)
693         AC_ARG_ENABLE([xinput],
694                       [AS_HELP_STRING([--enable-xinput], [Use the XI X extension])],
695                       [],
696                       [enable_xinput=yes])
697
698         AS_IF([test "x$enable_xinput" = "xyes"],
699               [
700                 PKG_CHECK_EXISTS([xi], [have_xinput=yes], [have_xinput=no])
701               ],
702               [
703                 have_xinput=no
704               ])
705
706         AS_CASE([$have_xinput],
707
708                 [yes],
709                 [
710                   AC_CHECK_HEADERS([X11/extensions/XInput2.h],
711                                    [
712                                      have_xinput2=yes
713                                      AC_DEFINE([HAVE_XINPUT_2],
714                                                [1],
715                                                [Define to 1 if XI2 is available])
716                                    ],
717                                    [
718                                      have_xinput2=no
719                                      AC_DEFINE([HAVE_XINPUT],
720                                                [1],
721                                                [Define to 1 if XInput is available])
722                                    ])
723
724                   clutter_save_LIBS="$LIBS"
725                   LIBS="$LIBS -lXi"
726
727                   AC_CHECK_FUNC([XIAllowTouchEvents],
728                                 [
729                                   AC_CHECK_MEMBER([XIScrollClassInfo.number],
730                                                   [
731                                                     have_xinput_2_2=yes
732                                                     AC_DEFINE([HAVE_XINPUT_2_2], [1], [Define to 1 if XInput 2.2 is available])
733                                                   ],
734                                                   [have_xinput_2_2=no],
735                                                   [[#include <X11/extensions/XInput2.h>]])])
736
737                   LIBS="$clutter_save_LIBS"
738
739                   X11_LIBS="$X11_LIBS $XINPUT_LIBS"
740                   X11_PC_FILES="$X11_PC_FILES xi"
741
742                   AS_IF([test "x$have_xinput_2_2" = "xyes"],
743                         [X11_EXTS="$X11_EXTS xi2.2"],
744                         [X11_EXTS="$X11_EXTS xi2.0"])
745                 ],
746
747                 [no],
748                 [have_xinput2=no],
749
750                 [*],
751                 [AC_MSG_ERROR([Invalid argument for --enable-xinput])]
752         )
753
754         # XKB
755         clutter_save_CPPFLAGS="$CPPFLAGS"
756         CPPFLAGS="$CPPFLAGS $X11_CFLAGS"
757
758         clutter_save_LIBS="$LIBS"
759         LIBS="$LIBS $X11_LIBS"
760
761         have_xkb=no
762         AC_CHECK_FUNC([XkbQueryExtension],
763                       [
764                         AC_DEFINE(HAVE_XKB, 1, [Define to use XKB extension])
765                         have_xkb=yes
766
767                         X11_EXTS="$X11_EXTS xkb"
768                       ])
769
770         CPPFLAGS="$clutter_save_CPPFLAGS"
771         LIBS="$clutter_save_LIBS"
772
773         x11_tests=yes
774         BACKEND_PC_FILES="$BACKEND_PC_FILES $X11_PC_FILES"
775         FLAVOUR_LIBS="$FLAVOUR_LIBS $X11_LIBS"
776         FLAVOUR_CFLAGS="$FLAVOUR_CFLAGS $X11_CFLAGS"
777       ]
778 )
779
780 AM_CONDITIONAL([BUILD_XI2], [test "x$have_xinput2" = "xyes"])
781 AM_CONDITIONAL([X11_TESTS], [test "x$x11_tests" = "xyes"])
782
783 X11_EXTS=${X11_EXTS#* }
784
785 AC_CACHE_SAVE
786
787 dnl === Enable GDK-Pixbuf in tests ============================================
788
789 m4_define([pixbuf_default], [yes])
790 AC_ARG_ENABLE([gdk-pixbuf],
791               [AS_HELP_STRING([--enable-gdk-pixbuf=@<:@no/yes@:>@],
792                               [Enable tests using GDK-Pixbuf @<:@default=]pixbuf_default[@:>@])],
793               [enable_pixbuf=$enable_val],
794               [enable_pixbuf=pixbuf_default])
795
796 AS_CASE([$enable_pixbuf],
797
798         [yes],
799         [
800           PKG_CHECK_MODULES([GDK_PIXBUF], [gdk-pixbuf-2.0])
801           AC_SUBST(GDK_PIXBUF_CFLAGS)
802           AC_SUBST(GDK_PIXBUF_LIBS)
803           pixbuf_tests=yes
804         ],
805
806         [no],
807         [
808           pixbuf_tests=no
809         ]
810 )
811
812 AM_CONDITIONAL([PIXBUF_TESTS], [test "x$pixbuf_tests" = "xyes"])
813
814 dnl === Enable debug level ====================================================
815
816 m4_define([debug_default], [m4_if(m4_eval(clutter_minor_version % 2), [1], [yes], [minimum])])
817 AC_ARG_ENABLE([debug],
818               [AS_HELP_STRING([--enable-debug=@<:@no/minimum/yes@:>@],
819                               [Control Clutter debugging level @<:@default=]debug_default[@:>@])],
820               [],
821               [enable_debug=debug_default])
822
823 AS_CASE([$enable_debug],
824
825         [yes],
826         [
827           test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
828           CLUTTER_DEBUG_CFLAGS="-DCLUTTER_ENABLE_DEBUG"
829         ],
830
831         [minimum],
832         [CLUTTER_DEBUG_CFLAGS="-DCLUTTER_ENABLE_DEBUG -DG_DISABLE_CAST_CHECKS"],
833
834         [no],
835         [CLUTTER_DEBUG_CFLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"],
836
837         [AC_MSG_ERROR([Unknown argument for --enable-debug])]
838 )
839
840 AC_SUBST(CLUTTER_DEBUG_CFLAGS)
841
842 dnl === Enable deprecation guards ==================================================
843
844 m4_define([deprecated_default],
845           [m4_if(m4_eval(clutter_minor_version % 2),
846                  [1],
847                  [no],
848                  [yes])])
849
850 AC_ARG_ENABLE([deprecated],
851               [AS_HELP_STRING([--enable-deprecated=@<:@no/yes@:>@],
852                               [Whether deprecated symbols should be disabled when compiling Clutter @<:@default=]deprecated_default[@:>@])],
853               [],
854               [enable_deprecated=deprecated_default])
855
856 AS_CASE([$enable_deprecated],
857
858         [no],
859         [
860           CLUTTER_DEPRECATED_CFLAGS="-DG_DISABLE_SINGLE_INCLUDES -DCOGL_DISABLE_DEPRECATED"
861         ],
862
863         [yes],
864         [
865           CLUTTER_DEPRECATED_CFLAGS="-DGLIB_DISABLE_DEPRECATION_WARNINGS"
866         ],
867
868         [AC_MSG_ERROR([Unknown argument for --enable-deprecated])]
869 )
870
871 AC_SUBST([CLUTTER_DEPRECATED_CFLAGS])
872
873
874 dnl === Profiling =============================================================
875
876 m4_define([profile_default], [no])
877 AC_ARG_ENABLE(profile,
878               AS_HELP_STRING([--enable-profile=@<:@no/yes@:>@],
879                              [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@:>@]),
880               [],
881               [enable_profile=profile_default])
882
883 AS_CASE([$enable_profile],
884
885         [yes],
886         [
887           AS_IF([test "x$GCC" = "xyes"],
888                 [
889                   PKG_CHECK_MODULES([PROFILE_DEP], [uprof-0.3])
890                   CLUTTER_PROFILE_CFLAGS="-DCLUTTER_ENABLE_PROFILE $PROFILE_DEP_CFLAGS"
891                   CLUTTER_PROFILE_LDFLAGS="$PROFILE_DEP_LIBS"
892
893                   AS_IF([test "x$enable_debug" = "xyes"], [CLUTTER_PROFILE_CFLAGS+=" -DUPROF_DEBUG"])
894                 ],
895                 [
896                   AC_MSG_ERROR([--enable-profile is currently only supported if using GCC])
897                 ])
898         ],
899
900         [no],
901         [
902           CLUTTER_PROFILE_CFLAGS=""
903           CLUTTER_PROFILE_LDFLAGS=""
904         ],
905
906         [*], [AC_MSG_ERROR([Invalid value for --enable-profile])]
907 )
908 AM_CONDITIONAL(PROFILE, test "x$enable_profile" != "xno")
909 AC_SUBST(CLUTTER_PROFILE_CFLAGS)
910 AC_SUBST(CLUTTER_PROFILE_LDFLAGS)
911
912 dnl === Coverage report =======================================================
913
914 AC_PATH_PROG([GCOV], [gcov], [enable_gcov=no])
915
916 AC_MSG_CHECKING([whether to build with gcov testing])
917
918 AC_ARG_ENABLE([gcov],
919               [AS_HELP_STRING([--enable-gcov],
920                               [Whether to enable coverage testing (requires gcc
921 and gcov)])],
922               [],
923               [enable_gcov=no])
924
925 AS_IF([test "x$enable_gcov" = "xyes" && test "x$GCC" = "xyes"],
926       [
927         AS_IF([test "x$enable_conformance" = "xno"],
928               [AC_MSG_WARN([Conformance test suite is disabled, the coverage report will be incomplete])],
929               [AC_MSG_RESULT([yes])]
930         )
931
932         GCOV_CFLAGS="-g -O0 -fprofile-arcs -ftest-coverage"
933         GCOV_LDFLAGS="-lgcov"
934       ],
935       [AC_MSG_RESULT([no])]
936 )
937
938 AM_CONDITIONAL([GCOV_ENABLED], [test "x$enable_gcov" = "xyes"])
939 AC_SUBST([GCOV_CFLAGS])
940 AC_SUBST([GCOV_LDFLAGS])
941
942 dnl === Enable strict compiler flags ==========================================
943
944 # use strict compiler flags only when building from git; the rules for
945 # distcheck will take care of turning this on when making a release
946 m4_define([maintainer_flags_default], [m4_if(m4_eval(clutter_micro_version % 2), [1], [yes], [no])])
947 AC_ARG_ENABLE([maintainer-flags],
948               [AS_HELP_STRING([--enable-maintainer-flags=@<:@no/yes/error@:>@],
949                               [Use strict compiler flags @<:@default=]maintainer_flags_default[@:>@])],
950               [],
951               [enable_maintainer_flags=maintainer_flags_default])
952
953 MAINTAINER_COMPILER_FLAGS="$MAINTAINER_COMPILER_FLAGS
954                            -Wall -Wcast-align -Wuninitialized
955                            -Wno-strict-aliasing -Wempty-body -Wformat
956                            -Wformat-security -Wformat-nonliteral -Winit-self
957                            -Wdeclaration-after-statement -Wvla
958                            -Wpointer-arith -Wmissing-declarations
959                            -Wcast-align
960                            -Wredundant-decls"
961
962 AS_CASE([$enable_maintainer_flags],
963         [yes],
964         [
965           AS_COMPILER_FLAGS([MAINTAINER_CFLAGS], [$MAINTAINER_COMPILER_FLAGS])
966         ],
967
968         [no],
969         [
970         ],
971
972         [error],
973         [
974           MAINTAINER_COMPILER_FLAGS="$MAINTAINER_COMPILER_FLAGS -Werror"
975           AS_COMPILER_FLAGS([MAINTAINER_CFLAGS], [$MAINTAINER_COMPILER_FLAGS])
976         ],
977
978         [*],
979         [AC_MSG_ERROR([Invalid option for --enable-maintainer-flags])]
980 )
981
982 # strip leading spaces
983 MAINTAINER_CFLAGS=${MAINTAINER_CFLAGS#*  }
984 AC_SUBST(MAINTAINER_CFLAGS)
985
986 dnl === Dependencies, compiler flags and linker libraries =====================
987 # strip leading space
988 BACKEND_PC_FILES=${BACKEND_PC_FILES#* }
989
990 # public dependencies, will fill the Requires: field of clutter.pc
991 CLUTTER_REQUIRES="$CLUTTER_BASE_PC_FILES $BACKEND_PC_FILES"
992 PKG_CHECK_MODULES(CLUTTER_DEPS, [$CLUTTER_REQUIRES])
993
994 # private dependencies, will fill the Requires.private: field of clutter.pc
995 AS_IF([test "x$CLUTTER_BASE_PC_FILES_PRIVATE" = "x" && test "x$BACKEND_PC_FILES_PRIVATE" = "x"],
996       [
997         CLUTTER_REQUIRES_PRIVATE=""
998         CLUTTER_DEPS_PRIVATE_CFLAGS=""
999         CLUTTER_DEPS_PRIVATE_LIBS=""
1000       ],
1001       [
1002         CLUTTER_REQUIRES_PRIVATE="$CLUTTER_BASE_PC_FILES_PRIVATE $BACKEND_PC_FILES_PRIVATE"
1003         PKG_CHECK_MODULES(CLUTTER_DEPS_PRIVATE, [$CLUTTER_REQUIRES_PRIVATE])
1004       ])
1005
1006 AC_SUBST(CLUTTER_REQUIRES)
1007 AC_SUBST(CLUTTER_REQUIRES_PRIVATE)
1008
1009 CLUTTER_CFLAGS="$FLAVOUR_CFLAGS $CLUTTER_DEPS_CFLAGS $CLUTTER_DEPS_PRIVATE_CFLAGS $CLUTTER_PROFILE_CFLAGS $GLIB_CFLAGS"
1010 CLUTTER_LIBS="$FLAVOUR_LIBS $CLUTTER_DEPS_LIBS $CLUTTER_DEPS_PRIVATE_LIBS $CLUTTER_PROFILE_LDFLAGS $GLIB_LIBS"
1011 AC_SUBST(CLUTTER_CFLAGS)
1012 AC_SUBST(CLUTTER_LIBS)
1013
1014
1015 dnl === GObject-Introspection check ===========================================
1016
1017 GOBJECT_INTROSPECTION_CHECK([gi_req_version])
1018
1019 dnl === GTK Doc check =========================================================
1020
1021 GTK_DOC_CHECK([gtk_doc_req_version], [--flavour no-tmpl])
1022
1023 # we don't want to build the documentation from a Git clone unless we
1024 # explicitly tell configure to do so; this allows avoiding to recurse into
1025 # the documentation directory when building Clutter inside Poky for a
1026 # target device that doesn't have gtk-doc installed. for reference
1027 # see: http://bugzilla.openedhand.com/show_bug.cgi?id=1047
1028 #
1029 # we use autogen.sh as it exists only inside the Git clones, and it
1030 # is not packaged into tarballs.
1031 AM_CONDITIONAL([BUILD_GTK_DOC], [test "x$enable_gtk_doc" = "xyes" || test ! -f "autogen.sh"])
1032
1033 # prefixes for fixing gtk-doc references
1034 CAIRO_PREFIX="`$PKG_CONFIG --variable=prefix cairo`"
1035 GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
1036 PANGO_PREFIX="`$PKG_CONFIG --variable=prefix pango`"
1037 COGL_PREFIX="`$PKG_CONFIG --variable=prefix cogl-1.0`"
1038 ATK_PREFIX="`$PKG_CONFIG --variable=prefix atk`"
1039 AC_SUBST(CAIRO_PREFIX)
1040 AC_SUBST(GLIB_PREFIX)
1041 AC_SUBST(PANGO_PREFIX)
1042 AC_SUBST(COGL_PREFIX)
1043 AC_SUBST(ATK_PREFIX)
1044
1045 dnl === Manual ================================================================
1046
1047 AC_ARG_ENABLE([docs],
1048               [AS_HELP_STRING([--enable-docs=@<:@no/yes@:>@],
1049                               [Build optional documentation; requires xsltproc and jw.])],
1050               [enable_docs=$enableval],
1051               [enable_docs=no])
1052
1053 enable_pdfs=no
1054 AS_IF([test "x$enable_docs" = "xyes"],
1055       [
1056         AC_PATH_PROG(JW, [jw], [no])
1057         AS_IF([test "x$JW" = "xno"],
1058               [
1059                 AC_MSG_WARN([jw not found; pdf generation has been disabled])
1060               ],
1061               [enable_pdfs=yes])
1062
1063         AC_PATH_PROG(XSLTPROC, [xsltproc], [no])
1064         AS_IF([test "x$XSLTPROC" = "xno"],
1065               [
1066                 AC_MSG_ERROR([xsltproc not found])
1067               ])
1068       ]
1069 )
1070
1071 AM_CONDITIONAL(ENABLE_DOCS, [test "x$enable_docs" = "xyes"])
1072 AM_CONDITIONAL(ENABLE_PDFS, [test "x$enable_pdfs" = "xyes"])
1073
1074 dnl === I18N ==================================================================
1075
1076 AM_GNU_GETTEXT_VERSION([0.17])
1077 AM_GNU_GETTEXT([external])
1078
1079 GETTEXT_PACKAGE="clutter-1.0"
1080 AC_SUBST(GETTEXT_PACKAGE)
1081 AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],
1082                    ["$GETTEXT_PACKAGE"],
1083                    [The prefix for our gettext translation domains.])
1084 AS_ALL_LINGUAS
1085
1086 dnl = Build optionals =========================================================
1087
1088 dnl === Conformance test suite ================================================
1089
1090 AC_ARG_ENABLE([conformance],
1091               [AS_HELP_STRING([--disable-conformance], [Whether the conformance tests should be built])],
1092               [],
1093               [enable_conformance=yes])
1094
1095 AC_ARG_ENABLE([tests],
1096               [AS_HELP_STRING([--disable-tests], [Whether tests should be built])],
1097               [],
1098               [enable_tests=yes])
1099 AM_CONDITIONAL(BUILD_TESTS, [test "x$enable_tests" = "xyes" && test "x$enable_conformance" = "xyes"])
1100
1101 AC_ARG_ENABLE([examples],
1102               [AS_HELP_STRING([--disable-examples], [Whether examples should be built])],
1103               [],
1104               [enable_examples=yes])
1105 AM_CONDITIONAL(BUILD_EXAMPLES, [test "x$enable_examples" = "xyes"])
1106
1107 dnl ===========================================================================
1108
1109 AC_CONFIG_FILES([
1110         Makefile
1111         config.h.win32
1112         README
1113
1114         build/Makefile
1115         build/autotools/Makefile
1116         build/mingw/Makefile
1117         build/win32/Makefile
1118         build/win32/vs9/Makefile
1119         build/win32/vs10/Makefile
1120
1121         clutter/Makefile
1122         clutter/clutter-config.h
1123         clutter/clutter-version.h
1124         clutter/clutter-$CLUTTER_API_VERSION.pc:clutter/clutter.pc.in
1125
1126         clutter/cally/cally-$CLUTTER_API_VERSION.pc:clutter/cally/cally.pc.in
1127
1128         clutter/cex100/clutter-cex100.h
1129
1130         tests/Makefile
1131         tests/accessibility/Makefile
1132         tests/conform/Makefile
1133         tests/conform/test-launcher.sh
1134         tests/data/Makefile
1135         tests/interactive/Makefile
1136         tests/interactive/wrapper.sh
1137         tests/micro-bench/Makefile
1138         tests/performance/Makefile
1139
1140         examples/Makefile
1141
1142         doc/Makefile
1143         doc/reference/Makefile
1144         doc/reference/clutter/Makefile
1145         doc/reference/clutter/clutter-docs.xml
1146         doc/reference/cally/Makefile
1147         doc/reference/cally/cally-docs.xml
1148         doc/common/Makefile
1149         doc/cookbook/Makefile
1150         doc/cookbook/clutter-cookbook.xml
1151         doc/cookbook/examples/Makefile
1152
1153         po/Makefile.in
1154 ])
1155
1156 AC_OUTPUT
1157
1158 dnl === Summary ===============================================================
1159
1160 echo ""
1161 echo "Clutter - $VERSION (${CLUTTER_RELEASE_STATUS})"
1162
1163 # Global flags
1164 echo ""
1165 echo " • Global:"
1166 echo "        Prefix: ${prefix}"
1167 echo "        Libdir: ${libdir}"
1168 echo "        Sysconfdir: ${sysconfdir}"
1169
1170 # Compiler/Debug related flags
1171 echo ""
1172 echo " • Compiler options:"
1173 echo "        Clutter debug level: ${enable_debug}"
1174 echo "        Compiler flags: ${CFLAGS} ${MAINTAINER_CFLAGS}"
1175 echo "        Profiling enabled: ${enable_profile}"
1176 echo "        Enable coverage tests: ${enable_gcov}"
1177 echo "        Enable deprecated symbols: ${enable_deprecated}"
1178
1179 # Documentation
1180 echo ""
1181 echo " • Documentation:"
1182 echo "        Build API Reference: ${enable_gtk_doc}"
1183 echo "        Build Additional Documentation: ${enable_docs} (Generate PDF: ${enable_pdfs})"
1184
1185 # Miscellaneous
1186 echo ""
1187 echo " • Extra:"
1188 echo "        Build introspection data: ${enable_introspection}"
1189 echo "        Build test suites: ${enable_tests}"
1190 if test "x$enable_tests" = "xyes"; then
1191 echo "        Build X11-specific tests: ${x11_tests}"
1192 echo "        Build tests using GDK-Pixbuf: ${pixbuf_tests}"
1193 fi
1194 echo "        Build examples: ${enable_examples}"
1195
1196 # Clutter backend related flags
1197 echo ""
1198 echo " • Clutter Backends:"
1199
1200 if test "x$experimental_backend" = "xno"; then
1201 echo "        Windowing systems: ${CLUTTER_BACKENDS}"
1202 else
1203 echo "        Windowing systems: ${CLUTTER_BACKENDS} (WARNING: Experimental backends enabled)"
1204 fi
1205
1206 if test "x$experimental_input_backend" = "xno"; then
1207 echo "        Input backends: ${CLUTTER_INPUT_BACKENDS}"
1208 else
1209 echo "        Input backends: ${CLUTTER_INPUT_BACKENDS} (WARNING: Experimental backends enabled)"
1210 fi
1211
1212 if test "x$SUPPORT_X11" = "x1"; then
1213 echo ""
1214 echo "     - X11 backend options:"
1215 echo "        Enabled extensions: ${X11_EXTS}"
1216 fi
1217
1218 if test "x$SUPPORT_CEX100" = "x1"; then
1219 echo ""
1220 echo "     - CEx100 backend options (WARNING: Experimental):"
1221 echo "        libGDL include prefix: ${CLUTTER_CEX100_LIBGDL_PREFIX}"
1222 fi
1223
1224 if test "x$SUPPORT_WAYLAND_COMPOSITOR" = "x1"; then
1225 echo ""
1226 echo "     - Wayland compositor support enabled (WARNING: Experimental)"
1227 fi
1228
1229 echo ""
1230
1231 # General warning about experimental features
1232 if test "x$experimental_backend" = "xyes"; then
1233 echo ""
1234 echo "☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠"
1235 echo "*WARNING* *WARNING* *WARNING* *WARNING* *WARNING* *WARNING* *WARNING*"
1236 echo ""
1237 echo "  The stability of your build might be affected by one or more"
1238 echo "  experimental backends or experimental and unsupported features"
1239 echo ""
1240 echo "*WARNING* *WARNING* *WARNING* *WARNING* *WARNING* *WARNING* *WARNING*"
1241 echo "☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠"
1242 echo ""
1243 fi