configure.ac 40.5 KB
Newer Older
1
# clutter package version number, (as distinct from shared library version)
2 3 4 5 6 7 8 9 10
# An odd micro number indicates in-progress development from Git
# An even micro number indicates a released version
#
# Making a point release:
# - increase clutter_micro_version to the next even number
# - increase clutter_interface_age to the next even number
# After the release:
# - increase clutter_micro_version to the next odd number
# - increase clutter_interface_version to the next odd number
Emmanuele Bassi's avatar
Emmanuele Bassi committed
11
m4_define([clutter_major_version], [1])
12
m4_define([clutter_minor_version], [9])
13
m4_define([clutter_micro_version], [6])
14

15 16 17
# • for stable releases: increase the interface age by 1 for each release;
#   if the API changes, set to 0. interface_age and binary_age are used to
#   create the soname of the shared object:
18 19 20 21 22 23
#
#  (<minor> * 100 + <micro>) - <interface_age>
#
# this allows using the same soname for different micro-releases in case
# no API was added or deprecated. for instance:
#
24 25 26
#   clutter 1.2.0  -> 100 * 2 + 0  = 200, interface age = 0 -> 200
#   clutter 1.2.2  -> 100 * 2 + 2  = 202, interface age = 2 -> 200
#   clutter 1.2.4  -> 100 * 2 + 4  = 204, interface age = 4 -> 200
27
#   [ API addition, deprecation ]
28 29 30
#   clutter 1.2.6  -> 100 * 2 + 6  = 206, interface age = 0 -> 206
#   clutter 1.2.8  -> 100 * 2 + 8  = 208, interface age = 2 -> 206
#   clutter 1.2.10 -> 100 * 2 + 10 = 210, interface age = 4 -> 206
31
#   ...
32
#
33
# • for development releases: keep clutter_interface_age to 0
Emmanuele Bassi's avatar
Emmanuele Bassi committed
34
m4_define([clutter_interface_age], [0])
Emmanuele Bassi's avatar
Emmanuele Bassi committed
35

36
m4_define([clutter_binary_age], [m4_eval(100 * clutter_minor_version + clutter_micro_version)])
37

Emmanuele Bassi's avatar
Emmanuele Bassi committed
38 39 40 41 42 43 44 45 46 47
m4_define([clutter_release_status],
          [m4_if(m4_eval(clutter_micro_version % 2), [1], [git],
                 [m4_if(m4_eval(clutter_minor_version % 2), [1], [snapshot],
                                                                 [release])])])

m4_define([clutter_version], [clutter_major_version.clutter_minor_version.clutter_micro_version])

# change this only when breaking the API
m4_define([clutter_api_version], [1.0])

48
AC_PREREQ([2.63])
49

50
AC_INIT([clutter],
51
        [clutter_version],
52
        [http://bugzilla.gnome.org/enter_bug.cgi?product=clutter],
53 54
        [clutter],
        [http://www.clutter-project.org])
55

56
AC_CONFIG_SRCDIR([clutter/clutter.h])
57 58 59
AC_CONFIG_HEADERS([config.h])
AC_CONFIG_AUX_DIR([build])
AC_CONFIG_MACRO_DIR([build/autotools])
Matthew Allum's avatar
Matthew Allum committed
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 65 66 67 68 69 70
AC_SUBST([CLUTTER_MAJOR_VERSION],  [clutter_major_version])
AC_SUBST([CLUTTER_MINOR_VERSION],  [clutter_minor_version])
AC_SUBST([CLUTTER_MICRO_VERSION],  [clutter_micro_version])
AC_SUBST([CLUTTER_VERSION],        [clutter_version])
AC_SUBST([CLUTTER_API_VERSION],    [clutter_api_version])
AC_SUBST([CLUTTER_API_VERSION_AM], [$CLUTTER_MAJOR_VERSION\_0])
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 76 77
CLUTTER_LT_CURRENT=lt_current
CLUTTER_LT_REV=lt_revision
CLUTTER_LT_AGE=lt_age
78 79
CLUTTER_LT_VERSION="$CLUTTER_LT_CURRENT:$CLUTTER_LT_REV:$CLUTTER_LT_AGE"
CLUTTER_LT_LDFLAGS="-version-info $CLUTTER_LT_VERSION"
80 81 82
AC_SUBST([CLUTTER_LT_CURRENT],  [lt_current])
AC_SUBST([CLUTTER_LT_REVISION], [lt_revision])
AC_SUBST([CLUTTER_LT_VERSION],  [$CLUTTER_LT_VERSION])
83

Emmanuele Bassi's avatar
Emmanuele Bassi committed
84 85
AC_PROG_SED

Emmanuele Bassi's avatar
Emmanuele Bassi committed
86 87
dnl = Preliminary platform checks =============================================

Emmanuele Bassi's avatar
Emmanuele Bassi committed
88
AC_CANONICAL_HOST
89 90 91 92 93

platform_win32=no
platform_quartz=no
platform_linux=no

94
AC_MSG_CHECKING([if building for some Win32 platform])
Emmanuele Bassi's avatar
Emmanuele Bassi committed
95 96 97 98 99 100 101
AS_CASE([$host],
        [*-*-mingw*|*-*-cygwin*],
        [
          CLUTTER_LT_LDFLAGS="$CLUTTER_LT_LDFLAGS -no-undefined"
          platform_win32=yes
        ],

102
        []
Emmanuele Bassi's avatar
Emmanuele Bassi committed
103
)
104
AC_MSG_RESULT([$platform_win32])
105

106
AM_CONDITIONAL(OS_WIN32, [test "$platform_win32" = "yes"])
107

108 109 110
AC_CHECK_HEADER([OpenGL/gl.h], [platform_quartz=yes], [platform_quartz=no])
AM_CONDITIONAL(OS_QUARTZ, [test "$platform_quartz" = "yes"])

111 112 113 114
AC_CHECK_HEADER([GL/glx.h], [platform_glx=yes], [platform_glx=no])
AC_CHECK_LIB([GL], [glXCreateContext], [platform_glx=yes], [platform_glx=no])
AM_CONDITIONAL(OS_GLX, [test "$platform_glx" = "yes"])

115 116
AC_SUBST(CLUTTER_LT_LDFLAGS)

Emmanuele Bassi's avatar
Emmanuele Bassi committed
117 118 119
AC_CACHE_SAVE

dnl = Dependencies =========================================================
120

Matthew Allum's avatar
Matthew Allum committed
121
# Checks for programs.
122
AM_PROG_CC_C_O
123 124 125 126

# require libtool >= 2.2
LT_PREREQ([2.2.6])
LT_INIT([disable-static])
127

Matthew Allum's avatar
Matthew Allum committed
128 129 130
# Checks for header files.
AC_HEADER_STDC

Emmanuele Bassi's avatar
Emmanuele Bassi committed
131
# required versions for dependencies
Emmanuele Bassi's avatar
Emmanuele Bassi committed
132
m4_define([glib_req_version],           [2.31.0])
133
m4_define([cogl_req_version],           [1.9.4])
Emmanuele Bassi's avatar
Emmanuele Bassi committed
134
m4_define([json_glib_req_version],      [0.12.0])
135
m4_define([atk_req_version],            [2.1.5])
Emmanuele Bassi's avatar
Emmanuele Bassi committed
136 137 138 139
m4_define([cairo_req_version],          [1.10])
m4_define([pango_req_version],          [1.20])
m4_define([gi_req_version],             [0.9.5])
m4_define([uprof_req_version],          [0.3])
140
m4_define([gtk_doc_req_version],        [1.15])
141 142
m4_define([xfixes_req_version],         [3])
m4_define([xcomposite_req_version],     [0.4])
143
m4_define([gdk_req_version],            [3.0.0])
Emmanuele Bassi's avatar
Emmanuele Bassi committed
144

145 146 147 148 149 150 151 152 153 154
AC_SUBST([GLIB_REQ_VERSION],       [glib_req_version])
AC_SUBST([COGL_REQ_VERSION],       [cogl_req_version])
AC_SUBST([JSON_GLIB_REQ_VERSION],  [json_glib_req_version])
AC_SUBST([ATK_REQ_VERSION],        [atk_req_version])
AC_SUBST([CAIRO_REQ_VERSION],      [cairo_req_version])
AC_SUBST([PANGO_REQ_VERSION],      [pango_req_version])
AC_SUBST([GI_REQ_VERSION],         [gi_req_version])
AC_SUBST([UPROF_REQ_VERSION],      [uprof_req_version])
AC_SUBST([GTK_DOC_REQ_VERSION],    [gtk_doc_req_version])
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])
Emmanuele Bassi's avatar
Emmanuele Bassi committed
157

Matthew Allum's avatar
Matthew Allum committed
158
# Checks for typedefs, structures, and compiler characteristics.
Emmanuele Bassi's avatar
Emmanuele Bassi committed
159 160 161
AM_PATH_GLIB_2_0([glib_req_version],
                 [],
                 [AC_MSG_ERROR([glib-2.0 is required])],
162
                 [gobject gthread gmodule-no-export])
163

Emmanuele Bassi's avatar
Emmanuele Bassi committed
164
# Check for -Bsymbolic-functions to avoid intra-library PLT jumps
165
AC_ARG_ENABLE([Bsymbolic],
166
              [AS_HELP_STRING([--disable-Bsymbolic],
167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184
                              [Avoid linking with -Bsymbolic])],
              [],
              [
                saved_LDFLAGS="${LDFLAGS}"
                AC_MSG_CHECKING([for -Bsymbolic-functions linker flag])
                LDFLAGS=-Wl,-Bsymbolic-functions
                AC_TRY_LINK([], [int main (void) { return 0; }],
                            [
                              AC_MSG_RESULT([yes])
                              enable_Bsymbolic=yes
                            ],
                            [
                              AC_MSG_RESULT([no])
                              enable_Bsymbolic=no
                            ])
                LDFLAGS="${saved_LDFLAGS}"
              ])

Emmanuele Bassi's avatar
Emmanuele Bassi committed
185
AS_IF([test "x$enable_Bsymbolic" = "xyes"], [CLUTTER_LINK_FLAGS=-Wl[,]-Bsymbolic-functions])
186
AC_SUBST(CLUTTER_LINK_FLAGS)
Emmanuele Bassi's avatar
Emmanuele Bassi committed
187

Emmanuele Bassi's avatar
Emmanuele Bassi committed
188
AC_CACHE_SAVE
189 190

dnl ========================================================================
191

192 193
FLAVOUR_LIBS=""
FLAVOUR_CFLAGS=""
194
CLUTTER_BACKENDS=""
195
CLUTTER_INPUT_BACKENDS=""
196
CLUTTER_CONFIG_DEFINES=
197

198
experimental_backend=no
199
experimental_input_backend=no
200

Emmanuele Bassi's avatar
Emmanuele Bassi committed
201
# base dependencies for core
202
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"
Emmanuele Bassi's avatar
Emmanuele Bassi committed
203

204 205 206
# private base dependencies
CLUTTER_BASE_PC_FILES_PRIVATE=""

207 208
# backend specific pkg-config files
BACKEND_PC_FILES=""
209

210 211 212
# private backend specific dependencies
BACKEND_PC_FILES_PRIVATE=""

213 214
dnl === Clutter windowing system backend ======================================

215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238
AC_ARG_ENABLE([x11-backend],
              [AS_HELP_STRING([--enable-x11-backend=@<:@yes/no@:>@], [Enable the X11 backend (default=check)])],
              [enable_x11=$enableval],
              [enable_x11=check])
AC_ARG_ENABLE([win32-backend],
              [AS_HELP_STRING([--enable-win32-backend=@<:@yes/no@:>@], [Enable the Windows backend (default=check)])],
              [enable_win32=$enableval],
              [enable_win32=check])
AC_ARG_ENABLE([quartz-backend],
              [AS_HELP_STRING([--enable-quartz-backend=@<:@yes/no@:>@], [Enable the OS X backend (default=check)])],
              [enable_osx=$enableval],
              [enable_osx=check])
AC_ARG_ENABLE([gdk-backend],
              [AS_HELP_STRING([--enable-gdk-backend=@<:@yes/no@:>@], [Enable the GDK backend (default=check)])],
              [enable_gdk=$enableval],
              [enable_gdk=check])
AC_ARG_ENABLE([wayland-backend],
              [AS_HELP_STRING([--enable-wayland-backend=@<:@yes/no@:>@], [Enable the Wayland client backend (default=no)])],
              [enable_wayland=$enableval],
              [enable_wayland=no])
AC_ARG_ENABLE([egl-backend],
              [AS_HELP_STRING([--enable-egl-backend=@<:@yes/no@:>@], [Enable the EGL framebuffer backend (default=no)])],
              [enable_egl=$enableval],
              [enable_egl=no])
239 240 241 242
AC_ARG_ENABLE([cex100-backend],
              [AS_HELP_STRING([--enable-cex100-backend=@<:@yes/no@:>@], [Enable the CEx100 backend (default=no)])],
              [enable_cex100=$enableval],
              [enable_cex100=no])
243

244
dnl Define default values
245 246 247 248
AS_IF([test "x$enable_x11" = "xcheck"],
      [
        AS_IF([test "x$platform_glx" = "xyes"], [enable_x11=yes], [enable_x11=no])
      ])
249

250 251 252 253
AS_IF([test "x$enable_win32" = "xcheck"],
      [
        AS_IF([test "x$platform_win32" = "xyes"], [enable_win32=yes], [enable_win32=no])
      ])
Kristian Høgsberg's avatar
Kristian Høgsberg committed
254

255 256 257 258
AS_IF([test "x$enable_osx" = "xcheck"],
      [
        AS_IF([test "x$platform_quartz" = "xyes"], [enable_osx=yes], [enable_osx=no])
      ])
Kristian Høgsberg's avatar
Kristian Høgsberg committed
259

260 261 262 263
AS_IF([test "x$enable_gdk" = "xcheck"],
      [
        PKG_CHECK_EXISTS([gdk-3.0 >= gdk_req_version], [enable_gdk=yes], [enable_gdk=no])
      ])
Kristian Høgsberg's avatar
Kristian Høgsberg committed
264

265 266 267 268
dnl Per-backend rules
AS_IF([test "x$enable_x11" = "xyes"],
      [
        CLUTTER_BACKENDS="$CLUTTER_BACKENDS x11"
269
        CLUTTER_INPUT_BACKENDS="$CLUTTER_INPUT_BACKENDS x11"
Kristian Høgsberg's avatar
Kristian Høgsberg committed
270

271 272 273
        SUPPORT_X11=1
        SUPPORT_GLX=1
        SUPPORT_COGL=1
274

275 276 277
        # we use fontconfig API and pango-ft2 when the fontconfig
        # configuration changes; we don't expose any API for this
        # so we add pango-ft2 to the private Requires.
278 279 280
        PKG_CHECK_EXISTS([pangoft2],
                         [
                           AC_DEFINE([HAVE_PANGO_FT2], [1], [Supports PangoFt2])
281
                           BACKEND_PC_FILES_PRIVATE="$BACKEND_PC_FILES_PRIVATE pangoft2"
282 283
                         ],
                         [])
284

285 286
        AC_DEFINE([HAVE_CLUTTER_GLX], [1], [Have the GLX backend])
      ])
287

288 289 290
AS_IF([test "x$enable_gdk" = "xyes"],
      [
        CLUTTER_BACKENDS="$CLUTTER_BACKENDS gdk"
291
        CLUTTER_INPUT_BACKENDS="$CLUTTER_INPUT_BACKENDS gdk"
292

293 294
	SUPPORT_GDK=1
        SUPPORT_COGL=1
295

296 297
	BACKEND_PC_FILES="$BACKEND_PC_FILES gdk-3.0"
      ])
298

299 300 301
AS_IF([test "x$enable_wayland" = "xyes"],
      [
        CLUTTER_BACKENDS="$CLUTTER_BACKENDS wayland"
302
        CLUTTER_INPUT_BACKENDS="$CLUTTER_INPUT_BACKENDS wayland"
303

304
        experimental_backend="yes"
305

306
        SUPPORT_WAYLAND=1
307

308 309 310 311 312
        PKG_CHECK_EXISTS([wayland-client xkbcommon gdk-pixbuf-2.0],
                         [
                            BACKEND_PC_FILES="$BACKEND_PC_FILES wayland-client xkbcommon",
                            BACKEND_PC_FILES_PRIVATE="$BACKEND_PC_FILES_PRIVATE gdk-pixbuf-2.0"
                         ],
313
                         [])
314

315
        AC_DEFINE([HAVE_CLUTTER_WAYLAND], [1], [Have the Wayland client backend])
316 317 318
      ])

dnl Note this is orthogonal to the client side support and you can
319
dnl use the Wayland compositor features with any of the clutter
320 321
dnl backends with corresponding Cogl support.
AC_ARG_ENABLE([wayland-compositor],
322 323
              [AS_HELP_STRING([--enable-wayland-compositor=@<:@yes/no@:>@],
                              [Enable Wayland compositor features (default=no)])],
324 325 326 327 328 329 330 331 332 333 334
              [],
              [AS_IF([test "x$SUPPORT_EGL" = "x1"],
                     [enable_wayland_compositor=yes],
                     [enable_wayland_compositor=no])
              ])

AS_IF([test "x$enable_wayland_compositor" = "xyes"],
      [
        PKG_CHECK_EXISTS([wayland-server],
			 [BACKEND_PC_FILES="$BACKEND_PC_FILES wayland-server"], [])
        SUPPORT_WAYLAND_COMPOSITOR=1
335 336
	CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
#define CLUTTER_HAS_WAYLAND_COMPOSITOR_SUPPORT 1"
337
        AC_DEFINE([HAVE_CLUTTER_WAYLAND_COMPOSITOR], [1], [Have Wayland compositor support])
338
      ])
339

340 341 342
AM_CONDITIONAL(SUPPORT_WAYLAND_COMPOSITOR, [test "x$SUPPORT_WAYLAND_COMPOSITOR" = "x1"])

AS_IF([test "x$enable_wayland_compositor" != "xyes" -a "x$enable_wayland" != "xyes"],
343 344 345 346
      [
        # The wayland headers introduce so much symbol shadowing that build
        # logs become incomprehensible with -Wshadow so we only use it for
        # non-wayland builds.
347
	MAINTAINER_COMPILER_FLAGS="-Wshadow"
348
      ])
349

350
AS_IF([test "x$enable_cex100" = "xyes"],
351
      [
352
        CLUTTER_BACKENDS="$CLUTTER_BACKENDS cex100"
353

354
        experimental_backend="yes"
355

356
        SUPPORT_COGL=1
357
        SUPPORT_CEX100=1
358

359 360
        have_gdl=no
        AC_CHECK_HEADERS([libgdl.h], [have_gdl=yes])
361

362
        AS_IF([test "x$have_gdl" = "xno"],
363
              [
364 365 366 367 368 369 370
                AC_CHECK_HEADERS([CE4100/libgdl.h],
                                 [
                                   FLAVOUR_CFLAGS="-I/usr/include/CE4100"
                                   have_gdl=yes
                                   CLUTTER_CEX100_LIBGDL_PREFIX=CE4100/
                                 ])
              ])
371

372 373
        AS_IF([test "x$have_gdl" = "xno"],
              [AC_MSG_ERROR([libgdl.h not found but the CEx100 backend has been explicitly enabled])])
374

375
        AC_SUBST(CLUTTER_CEX100_LIBGDL_PREFIX)
376

377
        FLAVOUR_LIBS="$FLAVOUR_LIBS -lgdl"
378

379 380 381 382
        AC_DEFINE([CLUTTER_EGL_BACKEND_CEX100], [1], [Use CEX100 EGL backend])
        AC_DEFINE([CLUTTER_EGL_BACKEND_GENERIC], [1], [Use Generic EGL backend])
        AC_DEFINE([HAVE_CLUTTER_EGL], [1], [Have the EGL backend])
      ])
383

384 385 386
AS_IF([test "x$enable_egl" = "xyes"],
      [
        CLUTTER_BACKENDS="$CLUTTER_BACKENDS egl"
387

388
        experimental_backend="yes"
389

390 391
        SUPPORT_EGL=1
        SUPPORT_COGL=1
392 393 394 395 396 397 398

        FLAVOUR_LIBS="$FLAVOUR_LIBS $TSLIB_LIBS $EVDEV_LIBS"
        FLAVOUR_CFLAGS="$FLAVOUR_CFLAGS $TSLIB_CFLAGS $EVDEV_CFLAGS"

        AC_DEFINE([CLUTTER_EGL_BACKEND_GENERIC], [1], [Use Generic EGL backend])

        AC_DEFINE([HAVE_CLUTTER_EGL], [1], [Have the EGL backend])
399 400
      ])

401
AS_IF([test "x$enable_osx" = "xyes"],
402
      [
403
        CLUTTER_BACKENDS="$CLUTTER_BACKENDS osx"
404
        CLUTTER_INPUT_BACKENDS="$CLUTTER_INPUT_BACKENDS osx"
405 406 407 408 409 410

        AC_DEFINE([HAVE_CLUTTER_OSX], [1], [Have the OSX backend])

        FLAVOUR_LIBS="$FLAVOUR_LIBS -framework Cocoa -framework OpenGL"

        SUPPORT_OSX=1
411 412
      ])

413
AS_IF([test "x$enable_win32" = "xyes"],
Kristian Høgsberg's avatar
Kristian Høgsberg committed
414
      [
415
        CLUTTER_BACKENDS="$CLUTTER_BACKENDS win32"
416
        CLUTTER_INPUT_BACKENDS="$CLUTTER_INPUT_BACKENDS win32"
417 418 419 420 421 422 423 424 425

        AC_DEFINE([HAVE_CLUTTER_WIN32], [1], [Have the Win32 backend])

        FLAVOUR_LIBS="$FLAVOUR_LIBS -lopengl32 -lgdi32 -lwinmm"
        FLAVOUR_CFLAGS="$FLAVOUR_CFLAGS -D_WIN32_WINNT=0x0500"

        AC_CHECK_TOOL(WINDRES, [windres], [AC_MSG_ERROR([*** windres is required])])

        SUPPORT_WIN32=1
Kristian Høgsberg's avatar
Kristian Høgsberg committed
426 427
      ])

428
AS_IF([test "x$CLUTTER_BACKENDS" = "x"],
429
      [
430
        AC_MSG_ERROR([No backend enabled. You need to enable at least one backend.])
431 432
      ])

433 434 435 436 437 438 439
# additional input backends

AC_ARG_ENABLE([tslib-input],
              [AS_HELP_STRING([--enable-tslib-input=@<:@yes/no@:>@], [Enable TSLib for input events (default=no)])],
              [enable_tslib=$enableval],
              [enable_tslib=no])
AC_ARG_ENABLE([evdev-input],
440
              [AS_HELP_STRING([--with-evdev=@<:@yes/no@:>@], [Enable evdev for input events (default=no)])],
441
              [enable_evdev=$enableval],
442
              [enable_evdev=no])
443 444 445 446 447 448

AS_IF([test "x$enable_tslib" = "xyes"],
      [
        PKG_CHECK_MODULES(TSLIB, [tslib-1.0], [have_tslib=yes], [have_tslib=no])
        AS_IF([test "x$have_tslib" = "xyes"],
              [
449 450
                CLUTTER_INPUT_BACKENDS="$CLUTTER_INPUT_BACKENDS tslib"
                experimental_input_backend="yes"
451 452 453 454 455 456 457 458 459 460
                AC_DEFINE([HAVE_TSLIB], [1], [Have tslib for touchscreen handling])
                SUPPORT_TSLIB=1
              ])
      ])

AS_IF([test "x$enable_evdev" = "xyes"],
      [
        PKG_CHECK_MODULES(EVDEV, [gudev-1.0 xkbcommon], [have_evdev=yes], [have_evdev=no])
        AS_IF([test "x$have_evdev" = "xyes"],
              [
461
                CLUTTER_INPUT_BACKENDS="$CLUTTER_INPUT_BACKENDS evdev"
462
                BACKEND_PC_FILES="$BACKEND_PC_FILES gudev-1.0 xkbcommon"
463
                experimental_input_backend="yes"
464 465 466 467 468
                AC_DEFINE([HAVE_EVDEV], [1], [Have evdev support for input handling])
                SUPPORT_EVDEV=1
              ])
      ])

469 470 471 472 473 474 475
# conditionals for use in automake files...
AM_CONDITIONAL(SUPPORT_GLX,     [test "x$SUPPORT_GLX" = "x1"])
AM_CONDITIONAL(SUPPORT_X11,     [test "x$SUPPORT_X11" = "x1"])
AM_CONDITIONAL(SUPPORT_GDK,     [test "x$SUPPORT_GDK" = "x1"])
AM_CONDITIONAL(SUPPORT_EGL,     [test "x$SUPPORT_EGL" = "x1"])
AM_CONDITIONAL(SUPPORT_OSX,     [test "x$SUPPORT_OSX" = "x1"])
AM_CONDITIONAL(SUPPORT_WIN32,   [test "x$SUPPORT_WIN32" = "x1"])
476
AM_CONDITIONAL(SUPPORT_CEX100,  [test "x$SUPPORT_CEX100" = "x1"])
477 478 479
AM_CONDITIONAL(SUPPORT_WAYLAND, [test "x$SUPPORT_WAYLAND" = "x1"])

AM_CONDITIONAL(USE_COGL,  [test "x$SUPPORT_COGL" = "x1"])
480
AM_CONDITIONAL(USE_TSLIB, [test "x$have_tslib" = "xyes"])
481 482
AM_CONDITIONAL(USE_EVDEV, [test "x$have_evdev" = "xyes"])
AM_CONDITIONAL(USE_GLD,   [test "x$have_gdl" = "xyes"])
483

484 485 486 487 488
dnl Instead of using AM_CFLAGS to ensure
dnl COGL_ENABLE_EXPERIMENTAL_2_0_API is defined while compiling clutter
dnl and cogl code we use a define in config.h instead. This helps ensure
dnl other tools such as glib-mkenums and gir-scanner don't end up
dnl using the define also.
489
AC_DEFINE([COGL_ENABLE_EXPERIMENTAL_2_0_API], [1], [Can use Cogl 2.0 API internally])
490

491 492 493 494
dnl strip leading spaces
CLUTTER_BACKENDS=${CLUTTER_BACKENDS#* }
AC_SUBST(CLUTTER_BACKENDS)

495 496 497
CLUTTER_INPUT_BACKENDS=${CLUTTER_INPUT_BACKENDS#* }
AC_SUBST(CLUTTER_INPUT_BACKENDS)

Emmanuele Bassi's avatar
Emmanuele Bassi committed
498 499
AC_CACHE_SAVE

500 501 502
dnl === Clutter configuration =================================================

# windowing systems
503
AS_IF([test "x$SUPPORT_X11" = "x1"],
504
      [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
505 506
#define CLUTTER_WINDOWING_X11 \"x11\"
#define CLUTTER_INPUT_X11 \"x11\""])
Giovanni Campagna's avatar
Giovanni Campagna committed
507 508
AS_IF([test "x$SUPPORT_GDK" = "x1"],
      [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
509 510
#define CLUTTER_WINDOWING_GDK \"gdk\"
#define CLUTTER_INPUT_GDK \"gdk\""])
511 512
AS_IF([test "x$SUPPORT_GLX" = "x1"],
      [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
513
#define CLUTTER_WINDOWING_GLX \"glx\""])
514 515
AS_IF([test "x$SUPPORT_EGL" = "x1"],
      [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
516
#define CLUTTER_WINDOWING_EGL \"eglnative\""])
517
AS_IF([test "x$SUPPORT_WAYLAND" = "x1"],
518
      [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
519
#define CLUTTER_WINDOWING_WAYLAND \"wayland\""])
520
AS_IF([test "x$SUPPORT_OSX" = "x1"],
521
      [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
522 523
#define CLUTTER_WINDOWING_OSX \"osx\"
#define CLUTTER_INPUT_OSX \"osx\""])
524
AS_IF([test "x$SUPPORT_WIN32" = "x1"],
525
      [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
526 527
#define CLUTTER_WINDOWING_WIN32 \"win32\"
#define CLUTTER_INPUT_WIN32 \"win32\""])
528
AS_IF([test "x$SUPPORT_CEX100" = "x1"],
529
      [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
530
#define CLUTTER_WINDOWING_CEX100 \"cex100\""])
531 532
AS_IF([test "x$SUPPORT_EVDEV" = "x1"],
      [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
533
#define CLUTTER_INPUT_EVDEV \"evdev\""])
534 535
AS_IF([test "x$SUPPORT_TSLIB" = "x1"],
      [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
536
#define CLUTTER_INPUT_TSLIB \"tslib\""])
537 538 539
AS_IF([test "x$SUPPORT_WAYLAND" = "x1"],
      [CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
#define CLUTTER_INPUT_WAYLAND \"wayland\""])
540

541 542 543 544
# the 'null' input backend is special
CLUTTER_CONFIG_DEFINES="$CLUTTER_CONFIG_DEFINES
#define CLUTTER_INPUT_NULL \"null\""

545 546
AC_SUBST([CLUTTER_CONFIG_DEFINES])

547
dnl === Clutter substitutions kept for backwards compatibility ================
548 549 550 551 552 553 554
AC_SUBST([CLUTTER_WINSYS],       [deprecated])
AC_SUBST([CLUTTER_WINSYS_BASE],  [deprecated])
AC_SUBST([CLUTTER_STAGE_TYPE],   [deprecated])
AC_SUBST([CLUTTER_SONAME_INFIX], [deprecated])
AC_SUBST([CLUTTER_FLAVOUR],      [deprecated])
AC_SUBST([CLUTTER_COGL],         [deprecated])
AC_SUBST([COGL_DRIVER],          [deprecated])
555

556 557
dnl === X11 checks, only for X11-based backends ===============================
X11_PC_FILES=""
558
X11_EXTS=""
559
x11_tests=no
560

561
AS_IF([test "x$SUPPORT_X11" = "x1"],
562 563 564
      [
        # base X11 includes and libraries
        AC_MSG_CHECKING([for X11])
565

566 567 568 569 570
        # start with pkg-config
        PKG_CHECK_EXISTS([x11], [have_x11=yes], [have_x11=no])
        AS_IF([test "x$have_x11" = "xyes"],
              [
                X11_PC_FILES="x11"
571 572 573 574 575

                # we actually need to ask for CFLAGS and LIBS
                X11_CFLAGS=`$PKG_CONFIG --cflags $X11_PC_FILES`
                X11_LIBS=`$PKG_CONFIG --libs $X11_PC_FILES`

576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595
                AC_MSG_RESULT([found])
              ],
              [
                # no pkg-config, let's go old school
                AC_PATH_X

                AS_IF([test "x$no_x" = "xyes"],
                      [AC_MSG_ERROR([No X11 Libraries found])],
                      [
                        AS_IF([test "x$x_includes" != "xNONE" && test -n "$x_includes"],
                              [X11_CFLAGS=-I`echo $x_includes | sed -e "s/:/ -I/g"`])

                        AS_IF([test "x$x_libraries" != "xNONE" && test -n "$x_libraries"],
                              [X11_LIBS=-L`echo $x_libraries | sed -e "s/:/ -L/g"`])

                        AC_MSG_RESULT([found])
                      ]
                )
              ]
        )
Emmanuele Bassi's avatar
Emmanuele Bassi committed
596 597 598 599 600 601 602 603 604 605

        # XEXT (required)
        AC_MSG_CHECKING([for XEXT extension])
        PKG_CHECK_EXISTS([xext], [have_xext=yes], [have_xext=no])
        AS_IF([test "x$have_xext" = "xyes"],
              [
                AC_DEFINE(HAVE_XEXT, [1], [Define to 1 if we have the XEXT X extension])

                X11_LIBS="$X11_LIBS -lXext"
                X11_PC_FILES="$X11_PC_FILES xext"
606
                X11_EXTS="$X11_EXTS xext"
Emmanuele Bassi's avatar
Emmanuele Bassi committed
607 608 609 610 611

                AC_MSG_RESULT([found])
              ],
              [AC_MSG_ERROR([Not found])]
        )
612 613

        # XFIXES (required)
614 615
        AC_MSG_CHECKING([for XFIXES extension >= $XFIXES_REQ_VERSION])
        PKG_CHECK_EXISTS([xfixes >= $XFIXES_REQ_VERSION], [have_xfixes=yes], [have_xfixes=no])
616 617 618 619 620
        AS_IF([test "x$have_xfixes" = "xyes"],
              [
                AC_DEFINE(HAVE_XFIXES, [1], [Define to 1 if we have the XFIXES X extension])

                X11_LIBS="$X11_LIBS -lXfixes"
621
                X11_PC_FILES="$X11_PC_FILES xfixes >= $XFIXES_REQ_VERSION"
622
                X11_EXTS="$X11_EXTS xfixes"
623

624 625 626 627
                AC_MSG_RESULT([found])
              ],
              [AC_MSG_ERROR([Not found])]
        )
628

629 630 631 632 633 634
        # XDAMAGE (required)
        AC_MSG_CHECKING([for XDAMAGE extension])
        PKG_CHECK_EXISTS([xdamage], [have_xdamage=yes], [have_xdamage=no])
        AS_IF([test "x$have_xdamage" = "xyes"],
              [
                AC_DEFINE(HAVE_XDAMAGE, [1], [Define to 1 if we have the XDAMAGE X extension])
635

636 637
                X11_LIBS="$X11_LIBS -lXdamage"
                X11_PC_FILES="$X11_PC_FILES xdamage"
638
                X11_EXTS="$X11_EXTS xdamage"
639

640 641 642 643
                AC_MSG_RESULT([found])
              ],
              [AC_MSG_ERROR([not found])]
        )
644

645
        # XCOMPOSITE (optional)
646 647
        AC_MSG_CHECKING([for XCOMPOSITE extension >= $XCOMPOSITE_REQ_VERSION])
        PKG_CHECK_EXISTS([xcomposite >= $XCOMPOSITE_REQ_VERSION], [have_xcomposite=yes], [have_xcomposite=no])
648 649 650
        AS_IF([test "x$have_xcomposite" = "xyes"],
              [
                AC_DEFINE(HAVE_XCOMPOSITE, [1], [Define to 1 if we have the XCOMPOSITE X extension])
651

652
                X11_LIBS="$X11_LIBS -lXcomposite"
653
                X11_PC_FILES="$X11_PC_FILES xcomposite >= $XCOMPOSITE_REQ_VERSION"
654
                X11_EXTS="$X11_EXTS xcomposite"
655

656 657
                AC_MSG_RESULT([found])
              ],
Emmanuele Bassi's avatar
Emmanuele Bassi committed
658
              [AC_MSG_ERROR([not found])]
659 660
        )

661 662 663 664 665 666 667 668 669 670
        # X Generic Extensions (optional)
        clutter_save_CPPFLAGS="$CPPFLAGS"
        CPPFLAGS="$CPPFLAGS $X11_CFLAGS"

        clutter_save_LIBS="$LIBS"
        LIBS="$LIBS $X11_LIBS"

        have_xge=no
        AC_CHECK_FUNC([XGetEventData],
                      [
671
                        AC_DEFINE([HAVE_XGE], [1], [Define to 1 if X Generic Extensions is available])
672
                        have_xge=yes
673
                        X11_EXTS="$X11_EXTS xge"
674 675 676 677 678
                      ])

        CPPFLAGS="$clutter_save_CPPFLAGS"
        LIBS="$clutter_save_LIBS"

679
        # XI (optional)
680
        AC_ARG_ENABLE([xinput],
681 682
                      [AS_HELP_STRING([--enable-xinput], [Use the XI X extension])],
                      [],
683
                      [enable_xinput=yes])
684

685 686 687 688 689 690 691 692 693
        AS_IF([test "x$enable_xinput" = "xyes"],
              [
                PKG_CHECK_EXISTS([xi], [have_xinput=yes], [have_xinput=no])
              ],
              [
                have_xinput=no
              ])

        AS_CASE([$have_xinput],
694 695 696

                [yes],
                [
697 698 699 700 701 702 703 704 705 706 707 708 709 710 711
                  AC_CHECK_HEADERS([X11/extensions/XInput2.h],
                                   [
                                     have_xinput2=yes
                                     AC_DEFINE([HAVE_XINPUT_2],
                                               [1],
                                               [Define to 1 if XI2 is available])
                                   ],
                                   [
                                     have_xinput2=no
                                     AC_DEFINE([HAVE_XINPUT],
                                               [1],
                                               [Define to 1 if XInput is available])
                                   ])

                  X11_LIBS="$X11_LIBS $XINPUT_LIBS"
712
                  X11_PC_FILES="$X11_PC_FILES xi"
713
                  X11_EXTS="$X11_EXTS xi"
714 715 716
                ],

                [no],
717 718 719 720
                [have_xinput2=no],

                [*],
                [AC_MSG_ERROR([Invalid argument for --enable-xinput])]
721 722
        )

723 724 725 726 727 728 729 730 731 732 733 734
        # XKB
        clutter_save_CPPFLAGS="$CPPFLAGS"
        CPPFLAGS="$CPPFLAGS $X11_CFLAGS"

        clutter_save_LIBS="$LIBS"
        LIBS="$LIBS $X11_LIBS"

        have_xkb=no
        AC_CHECK_FUNC([XkbQueryExtension],
                      [
                        AC_DEFINE(HAVE_XKB, 1, [Define to use XKB extension])
                        have_xkb=yes
735 736

                        X11_EXTS="$X11_EXTS xkb"
737 738 739 740 741
                      ])

        CPPFLAGS="$clutter_save_CPPFLAGS"
        LIBS="$clutter_save_LIBS"

Emmanuele Bassi's avatar
Emmanuele Bassi committed
742
        x11_tests=yes
743
        BACKEND_PC_FILES="$BACKEND_PC_FILES $X11_PC_FILES"
744 745
        FLAVOUR_LIBS="$FLAVOUR_LIBS $X11_LIBS"
        FLAVOUR_CFLAGS="$FLAVOUR_CFLAGS $X11_CFLAGS"
746 747
      ]
)
748

749
AM_CONDITIONAL([BUILD_XI2], [test "x$have_xinput2" = "xyes"])
750
AM_CONDITIONAL([X11_TESTS], [test "x$x11_tests" = "xyes"])
751

752 753 754
X11_EXTS=${X11_EXTS#* }

AC_CACHE_SAVE
755

756
dnl === Enable debug level ====================================================
Matthew Allum's avatar
Matthew Allum committed
757

758 759
m4_define([debug_default], [m4_if(m4_eval(clutter_minor_version % 2), [1], [yes], [minimum])])
AC_ARG_ENABLE([debug],
760
              [AS_HELP_STRING([--enable-debug=@<:@no/minimum/yes@:>@],
761
                              [Control Clutter debugging level @<:@default=]debug_default[@:>@])],
762 763 764 765 766 767 768 769
              [],
              [enable_debug=debug_default])

AS_CASE([$enable_debug],

        [yes],
        [
          test "$cflags_set" = set || CFLAGS="$CFLAGS -g"
770
          CLUTTER_DEBUG_CFLAGS="-DCLUTTER_ENABLE_DEBUG"
771 772 773
        ],

        [minimum],
774
        [CLUTTER_DEBUG_CFLAGS="-DCLUTTER_ENABLE_DEBUG -DG_DISABLE_CAST_CHECKS"],
775 776 777 778 779 780

        [no],
        [CLUTTER_DEBUG_CFLAGS="-DG_DISABLE_ASSERT -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"],

        [AC_MSG_ERROR([Unknown argument for --enable-debug])]
)
781 782 783

AC_SUBST(CLUTTER_DEBUG_CFLAGS)

784 785 786 787 788 789 790 791 792 793
dnl === Enable deprecation guards ==================================================

m4_define([deprecated_default],
          [m4_if(m4_eval(clutter_minor_version % 2),
                 [1],
                 [no],
                 [yes])])

AC_ARG_ENABLE([deprecated],
              [AS_HELP_STRING([--enable-deprecated=@<:@no/yes@:>@],
794
                              [Whether deprecated symbols should be disabled when compiling Clutter @<:@default=]deprecated_default[@:>@])],
795 796 797 798 799 800 801
              [],
              [enable_deprecated=deprecated_default])

AS_CASE([$enable_deprecated],

        [no],
        [
802
          CLUTTER_DEPRECATED_CFLAGS="-DG_DISABLE_SINGLE_INCLUDES -DCOGL_DISABLE_DEPRECATED"
803 804 805 806
        ],

        [yes],
        [
807
          CLUTTER_DEPRECATED_CFLAGS="-DGLIB_DISABLE_DEPRECATION_WARNINGS -DCLUTTER_DISABLE_DEPRECATION_WARNINGS"
808 809 810 811 812 813 814 815
        ],

        [AC_MSG_ERROR([Unknown argument for --enable-deprecated])]
)

AC_SUBST([CLUTTER_DEPRECATED_CFLAGS])


816 817 818
dnl === Conformance test suite ================================================

AC_ARG_ENABLE([conformance],
819
              [AS_HELP_STRING([--enable-conformance=@<:@no/yes@:>@],
820 821 822 823 824 825 826 827
                              [Build conformance test suite @<:@default=yes@:>@])],
              [],
              [enable_conformance=yes])

AM_CONDITIONAL([BUILD_TESTS], [test "x$enable_conformance" = "xyes"])

dnl === Profiling =============================================================

828 829
m4_define([profile_default], [no])
AC_ARG_ENABLE(profile,
830
              AS_HELP_STRING([--enable-profile=@<:@no/yes@:>@],
831
                             [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@:>@]),
832
              [],
833 834 835 836
              [enable_profile=profile_default])

AS_CASE([$enable_profile],

837 838 839 840
        [yes],
        [
          AS_IF([test "x$GCC" = "xyes"],
                [
841
                  PKG_CHECK_MODULES([PROFILE_DEP], [uprof-0.3])
842
                  CLUTTER_PROFILE_CFLAGS="-DCLUTTER_ENABLE_PROFILE $PROFILE_DEP_CFLAGS"
843
                  CLUTTER_PROFILE_LDFLAGS="$PROFILE_DEP_LIBS"
844 845 846 847 848 849 850 851 852 853 854 855 856 857 858

                  AS_IF([test "x$enable_debug" = "xyes"], [CLUTTER_PROFILE_CFLAGS+=" -DUPROF_DEBUG"])
                ],
                [
                  AC_MSG_ERROR([--enable-profile is currently only supported if using GCC])
                ])
        ],

        [no],
        [
          CLUTTER_PROFILE_CFLAGS=""
          CLUTTER_PROFILE_LDFLAGS=""
        ],

        [*], [AC_MSG_ERROR([Invalid value for --enable-profile])]
859 860 861 862 863
)
AM_CONDITIONAL(PROFILE, test "x$enable_profile" != "xno")
AC_SUBST(CLUTTER_PROFILE_CFLAGS)
AC_SUBST(CLUTTER_PROFILE_LDFLAGS)

864 865 866 867 868 869 870 871
dnl === Coverage report =======================================================

AC_PATH_PROG([GCOV], [gcov], [enable_gcov=no])

AC_MSG_CHECKING([whether to build with gcov testing])

AC_ARG_ENABLE([gcov],
              [AS_HELP_STRING([--enable-gcov],
872
                              [Whether to enable coverage testing (requires gcc
873 874 875 876 877 878
and gcov)])],
              [],
              [enable_gcov=no])

AS_IF([test "x$enable_gcov" = "xyes" && test "x$GCC" = "xyes"],
      [
879 880 881 882 883
        AS_IF([test "x$enable_conformance" = "xno"],
              [AC_MSG_WARN([Conformance test suite is disabled, the coverage report will be incomplete])],
              [AC_MSG_RESULT([yes])]
        )

884 885
        GCOV_CFLAGS="-g -O0 -fprofile-arcs -ftest-coverage"
        GCOV_LDFLAGS="-lgcov"
886 887
      ],
      [AC_MSG_RESULT([no])]
888 889 890 891 892 893
)

AM_CONDITIONAL([GCOV_ENABLED], [test "x$enable_gcov" = "xyes"])
AC_SUBST([GCOV_CFLAGS])
AC_SUBST([GCOV_LDFLAGS])

894
dnl === Enable strict compiler flags ==========================================
895

896 897 898
# use strict compiler flags only when building from git; the rules for
# distcheck will take care of turning this on when making a release
m4_define([maintainer_flags_default], [m4_if(m4_eval(clutter_micro_version % 2), [1], [yes], [no])])
899
AC_ARG_ENABLE([maintainer-flags],
900
              [AS_HELP_STRING([--enable-maintainer-flags=@<:@no/yes/error@:>@],
901
                              [Use strict compiler flags @<:@default=]maintainer_flags_default[@:>@])],
902 903 904
              [],
              [enable_maintainer_flags=maintainer_flags_default])

905 906
MAINTAINER_COMPILER_FLAGS="$MAINTAINER_COMPILER_FLAGS
                           -Wall -Wcast-align -Wuninitialized
907 908
                           -Wno-strict-aliasing -Wempty-body -Wformat
                           -Wformat-security -Winit-self
909 910
                           -Wdeclaration-after-statement -Wvla
                           -Wpointer-arith"
911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929

AS_CASE([$enable_maintainer_flags],
        [yes],
        [
          AS_COMPILER_FLAGS([MAINTAINER_CFLAGS], [$MAINTAINER_COMPILER_FLAGS])
        ],

        [no],
        [
        ],

        [error],
        [
          MAINTAINER_COMPILER_FLAGS="$MAINTAINER_COMPILER_FLAGS -Werror"
          AS_COMPILER_FLAGS([MAINTAINER_CFLAGS], [$MAINTAINER_COMPILER_FLAGS])
        ],

        [*],
        [AC_MSG_ERROR([Invalid option for --enable-maintainer-flags])]
930
)
931

932
# strip leading spaces
Emmanuele Bassi's avatar
Emmanuele Bassi committed
933
MAINTAINER_CFLAGS=${MAINTAINER_CFLAGS#*  }
934
AC_SUBST(MAINTAINER_CFLAGS)
935

936
dnl === Dependencies, compiler flags and linker libraries =====================
937
# strip leading space
Emmanuele Bassi's avatar
Emmanuele Bassi committed
938
BACKEND_PC_FILES=${BACKEND_PC_FILES#* }
939

940
# public dependencies, will fill the Requires: field of clutter.pc
941
CLUTTER_REQUIRES="$CLUTTER_BASE_PC_FILES $BACKEND_PC_FILES"
942 943
PKG_CHECK_MODULES(CLUTTER_DEPS, [$CLUTTER_REQUIRES])

944 945
# private dependencies, will fill the Requires.private: field of clutter.pc
AS_IF([test "x$CLUTTER_BASE_PC_FILES_PRIVATE" = "x" && test "x$BACKEND_PC_FILES_PRIVATE" = "x"],
946 947 948 949
      [
        CLUTTER_REQUIRES_PRIVATE=""
        CLUTTER_DEPS_PRIVATE_CFLAGS=""
        CLUTTER_DEPS_PRIVATE_LIBS=""
950 951 952 953
      ],
      [
        CLUTTER_REQUIRES_PRIVATE="$CLUTTER_BASE_PC_FILES_PRIVATE $BACKEND_PC_FILES_PRIVATE"
        PKG_CHECK_MODULES(CLUTTER_DEPS_PRIVATE, [$CLUTTER_REQUIRES_PRIVATE])
954
      ])
955

956
AC_SUBST(CLUTTER_REQUIRES)
957 958
AC_SUBST(CLUTTER_REQUIRES_PRIVATE)

959 960
CLUTTER_CFLAGS="$FLAVOUR_CFLAGS $CLUTTER_DEPS_CFLAGS $CLUTTER_DEPS_PRIVATE_CFLAGS $CLUTTER_PROFILE_CFLAGS $GLIB_CFLAGS"
CLUTTER_LIBS="$FLAVOUR_LIBS $CLUTTER_DEPS_LIBS $CLUTTER_DEPS_PRIVATE_LIBS $CLUTTER_PROFILE_LDFLAGS $GLIB_LIBS"
961 962 963
AC_SUBST(CLUTTER_CFLAGS)
AC_SUBST(CLUTTER_LIBS)

964

965
dnl === GObject-Introspection check ===========================================
966

Emmanuele Bassi's avatar
Emmanuele Bassi committed
967
GOBJECT_INTROSPECTION_CHECK([gi_req_version])
968

969
dnl === GTK Doc check =========================================================
970

Emmanuele Bassi's avatar
Emmanuele Bassi committed
971
GTK_DOC_CHECK([gtk_doc_req_version], [--flavour no-tmpl])
972

973
# we don't want to build the documentation from a Git clone unless we
974 975 976 977 978
# explicitly tell configure to do so; this allows avoiding to recurse into
# the documentation directory when building Clutter inside Poky for a
# target device that doesn't have gtk-doc installed. for reference
# see: http://bugzilla.openedhand.com/show_bug.cgi?id=1047
#
979
# we use autogen.sh as it exists only inside the Git clones, and it
980
# is not packaged into tarballs.
981
AM_CONDITIONAL([BUILD_GTK_DOC], [test "x$enable_gtk_doc" = "xyes" || test ! -f "autogen.sh"])
982

983
# prefixes for fixing gtk-doc references
984
CAIRO_PREFIX="`$PKG_CONFIG --variable=prefix cairo`"
985 986
GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
PANGO_PREFIX="`$PKG_CONFIG --variable=prefix pango`"
987
COGL_PREFIX="`$PKG_CONFIG --variable=prefix cogl-1.0`"
Emmanuele Bassi's avatar
Emmanuele Bassi committed
988
ATK_PREFIX="`$PKG_CONFIG --variable=prefix atk`"
989
AC_SUBST(CAIRO_PREFIX)
990 991
AC_SUBST(GLIB_PREFIX)
AC_SUBST(PANGO_PREFIX)
992
AC_SUBST(COGL_PREFIX)
Emmanuele Bassi's avatar
Emmanuele Bassi committed
993
AC_SUBST(ATK_PREFIX)
994

995 996
dnl === Manual ================================================================

997
AC_ARG_ENABLE([docs],
998
              [AS_HELP_STRING([--enable-docs=@<:@no/yes@:>@],
999 1000 1001 1002 1003 1004
                              [Build optional documentation; requires xsltproc and jw.])],
              [enable_docs=$enableval],
              [enable_docs=no])

enable_pdfs=no
AS_IF([test "x$enable_docs" = "xyes"],
1005 1006 1007
      [
        AC_PATH_PROG(JW, [jw], [no])
        AS_IF([test "x$JW" = "xno"],
1008 1009 1010 1011
              [
                AC_MSG_WARN([jw not found; pdf generation has been disabled])
              ],
              [enable_pdfs=yes])
1012 1013 1014

        AC_PATH_PROG(XSLTPROC, [xsltproc], [no])
        AS_IF([test "x$XSLTPROC" = "xno"],
1015 1016 1017
              [
                AC_MSG_ERROR([xsltproc not found])
              ])
1018 1019
      ]
)
Matthew Allum's avatar
Matthew Allum committed
1020

1021 1022
AM_CONDITIONAL(ENABLE_DOCS, [test "x$enable_docs" = "xyes"])
AM_CONDITIONAL(ENABLE_PDFS, [test "x$enable_pdfs" = "xyes"])
Matthew Allum's avatar
Matthew Allum committed
1023

1024
dnl === I18N ==================================================================
Matthew Allum's avatar
Matthew Allum committed
1025

1026
AM_GNU_GETTEXT_VERSION([0.17])
1027 1028
AM_GNU_GETTEXT([external])

Emmanuele Bassi's avatar
Emmanuele Bassi committed
1029
GETTEXT_PACKAGE="clutter-1.0"
1030
AC_SUBST(GETTEXT_PACKAGE)
Emmanuele Bassi's avatar
Emmanuele Bassi committed
1031 1032
AC_DEFINE_UNQUOTED([GETTEXT_PACKAGE],
                   ["$GETTEXT_PACKAGE"],
1033
                   [The prefix for our gettext translation domains.])