~oem-solutions-group/unity-2d/clutter-1.0

« back to all changes in this revision

Viewing changes to configure.ac

  • Committer: Bazaar Package Importer
  • Author(s): Emilio Pozuelo Monfort
  • Date: 2010-03-21 13:27:56 UTC
  • mto: (2.1.3 experimental)
  • mto: This revision was merged to the branch mainline in revision 8.
  • Revision ID: james.westby@ubuntu.com-20100321132756-nf8yd30yxo3zzwcm
Tags: upstream-1.2.2
Import upstream version 1.2.2

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
# clutter package version number, (as distinct from shared library version)
2
 
# An odd micro number indicates in-progress development, (eg. from CVS)
3
 
# An even micro number indicates a released version.
 
2
# An odd micro number indicates in-progress development from Git
 
3
# An even micro number indicates a released version
4
4
#
5
5
# Making a point release:
6
6
# - increase clutter_micro_version to the next even number
11
11
# - increase clutter_micro_version to the next odd number
12
12
# - increase clutter_interface_version to the next odd number
13
13
m4_define([clutter_major_version], [1])
14
 
m4_define([clutter_minor_version], [0])
15
 
m4_define([clutter_micro_version], [8])
 
14
m4_define([clutter_minor_version], [2])
 
15
m4_define([clutter_micro_version], [2])
 
16
 
 
17
m4_define([clutter_release_status],
 
18
          [m4_if(m4_eval(clutter_micro_version % 2), [1], [git],
 
19
                 [m4_if(m4_eval(clutter_minor_version % 2), [1], [snapshot],
 
20
                                                                 [release])])])
16
21
 
17
22
m4_define([clutter_version], [clutter_major_version.clutter_minor_version.clutter_micro_version])
18
23
 
 
24
# change this only when breaking the API
19
25
m4_define([clutter_api_version], [1.0])
20
26
 
21
27
# increase the interface age by 1 for each release; if the API changes,
27
33
# this allows using the same soname for different micro-releases in case
28
34
# no API was added or deprecated. for instance:
29
35
#
30
 
#   clutter 1.2.0 -> 100 * 2 + 0 = 200, interface age = 0 -> 200
31
 
#   clutter 1.2.2 -> 100 * 2 + 2 = 202, interface age = 2 -> 200
32
 
#   clutter 1.2.4 -> 100 * 2 + 4 = 204, interface age = 4 -> 200
 
36
#   clutter 1.2.0  -> 100 * 2 + 0  = 200, interface age = 0 -> 200
 
37
#   clutter 1.2.2  -> 100 * 2 + 2  = 202, interface age = 2 -> 200
 
38
#   clutter 1.2.4  -> 100 * 2 + 4  = 204, interface age = 4 -> 200
33
39
#   [ API addition, deprecation ]
34
 
#   clutter 1.2.6 -> 100 * 2 + 6 = 206, interface age = 0 -> 206
 
40
#   clutter 1.2.6  -> 100 * 2 + 6  = 206, interface age = 0 -> 206
 
41
#   clutter 1.2.8  -> 100 * 2 + 8  = 208, interface age = 2 -> 206
 
42
#   clutter 1.2.10 -> 100 * 2 + 10 = 210, interface age = 4 -> 206
35
43
#   ...
36
44
#
37
 
m4_define([clutter_interface_age], [0])
 
45
m4_define([clutter_interface_age], [2])
38
46
m4_define([clutter_binary_age], [m4_eval(100 * clutter_minor_version + clutter_micro_version)])
39
47
 
40
48
AC_PREREQ([2.59])
42
50
AC_INIT([clutter],
43
51
        [clutter_version],
44
52
        [http://bugzilla.o-hand.com/enter_bug.cgi?product=Clutter])
 
53
 
 
54
AC_CONFIG_SRCDIR([clutter/clutter.h])
 
55
AC_CONFIG_HEADERS([config.h])
 
56
AC_CONFIG_AUX_DIR([build])
45
57
AC_CONFIG_MACRO_DIR([build/autotools])
46
 
AC_CONFIG_SRCDIR([clutter/clutter.h])
47
 
AM_CONFIG_HEADER([config.h])
48
58
 
49
 
AM_INIT_AUTOMAKE([1.9])
 
59
AM_INIT_AUTOMAKE([1.10 foreign -Wno-portability no-define dist-bzip2 check-news])
50
60
 
51
61
CLUTTER_MAJOR_VERSION=clutter_major_version
52
62
CLUTTER_MINOR_VERSION=clutter_minor_version
54
64
CLUTTER_VERSION=clutter_version
55
65
CLUTTER_API_VERSION=clutter_api_version
56
66
CLUTTER_MAJORMINOR=clutter_major_version.clutter_minor_version
 
67
CLUTTER_RELEASE_STATUS=clutter_release_status
57
68
AC_SUBST(CLUTTER_MAJOR_VERSION)
58
69
AC_SUBST(CLUTTER_MINOR_VERSION)
59
70
AC_SUBST(CLUTTER_MICRO_VERSION)
60
71
AC_SUBST(CLUTTER_VERSION)
61
72
AC_SUBST(CLUTTER_API_VERSION)
62
73
AC_SUBST(CLUTTER_MAJORMINOR)
 
74
AC_SUBST(CLUTTER_RELEASE_STATUS)
63
75
 
64
76
m4_define([lt_current],  [m4_eval(100 * clutter_minor_version + clutter_micro_version - clutter_interface_age)])
65
77
m4_define([lt_revision], [clutter_interface_age])
77
89
 
78
90
# Checks for programs.
79
91
AM_PROG_CC_C_O
80
 
AC_DISABLE_STATIC
81
 
AC_PROG_LIBTOOL
82
 
DOLT
 
92
 
 
93
# require libtool >= 2.2
 
94
LT_PREREQ([2.2.6])
 
95
LT_INIT([disable-static])
 
96
 
 
97
# Disable dolt; we should depend on libtool 2.2
 
98
#DOLT
83
99
 
84
100
# Checks for header files.
85
101
AC_HEADER_STDC
86
 
AC_CHECK_HEADERS([fcntl.h stdlib.h string.h unistd.h])
87
102
 
88
103
# Checks for typedefs, structures, and compiler characteristics.
89
 
AC_C_CONST
90
 
 
91
 
# Checks for library functions.
92
 
AC_FUNC_MALLOC
93
 
AC_FUNC_MMAP
94
 
AC_CHECK_FUNCS([memset memcpy strcasecmp])
95
 
 
96
104
AC_PATH_PROG([GLIB_MKENUMS], [glib-mkenums])
97
105
AC_PATH_PROG([GLIB_GENMARSHAL], [glib-genmarshal])
98
106
 
101
109
dnl ========================================================================
102
110
 
103
111
# defaults
104
 
backendextra=
105
 
backendextralib=
106
 
clutterbackend=glx
 
112
CLUTTER_WINSYS_BASE=
 
113
CLUTTER_WINSYS_BASE_LIB=
 
114
CLUTTER_WINSYS=glx
107
115
clutter_gl_header=""
108
116
glesversion=1.1
109
117
use_gles2_wrapper=no
111
119
experimental_image=no
112
120
 
113
121
AC_ARG_WITH([flavour],
114
 
            [AC_HELP_STRING([--with-flavour=@<:@glx/eglx/eglnative/sdl/osx/win32/fruity@:>@],
115
 
                            [Select the Clutter backend])],
116
 
            [clutterbackend=$with_flavour])
 
122
            [AC_HELP_STRING([--with-flavour=@<:@glx/eglx/eglnative/osx/win32/fruity@:>@],
 
123
                            [Select the Clutter window system backend])],
 
124
            [CLUTTER_WINSYS=$with_flavour])
117
125
 
118
126
AC_ARG_WITH([gles],
119
127
            [AC_HELP_STRING([--with-gles=@<:@1.1/2.0@:>@],
121
129
            [glesversion=$with_gles])
122
130
 
123
131
# the fruity backend requires a different handling for GLES
124
 
AS_IF([test "x$clutterbackend" = "xfruity"], [glesversion=fruity])
 
132
AS_IF([test "x$CLUTTER_WINSYS" = "xfruity"], [glesversion=fruity])
125
133
 
126
134
# backend specific pkg-config files
127
135
BACKEND_PC_FILES=""
132
140
 
133
141
dnl === COGL GLES backend =====================================================
134
142
 
135
 
AS_IF([test "x$clutterbackend" = "xeglnative" ||
136
 
       test "x$clutterbackend" = "xeglx"      ||
137
 
       test "x$clutterbackend" = "xfruity"],
 
143
AS_IF([test "x$CLUTTER_WINSYS" = "xeglnative" ||
 
144
       test "x$CLUTTER_WINSYS" = "xeglx"      ||
 
145
       test "x$CLUTTER_WINSYS" = "xfruity"],
138
146
 
139
147
      [
140
148
        AS_CASE([$glesversion],
143
151
                [
144
152
                  clutter_gl_header="GLES/gl.h"
145
153
 
146
 
                  CLUTTER_COGL="gles"
 
154
                  COGL_DRIVER="gles"
147
155
                  AC_DEFINE([HAVE_COGL_GLES], 1, [Have GL/ES for rendering])
148
 
                  AC_SUBST(COGL_GLES_VERSION, [COGL_HAS_GLES1])
 
156
                  AC_SUBST(COGL_GLES_VERSION, [COGL_HAS_GLES1])
149
157
 
150
158
                  AC_CHECK_HEADERS([GLES/egl.h],
151
159
                                   [],
188
196
                [
189
197
                  clutter_gl_header="GLES2/gl2.h"
190
198
                  use_gles2_wrapper=yes
191
 
                  CLUTTER_COGL="gles"
 
199
                  COGL_DRIVER="gles"
192
200
                  AC_DEFINE([HAVE_COGL_GLES2], 1, [Have GL/ES for rendering])
193
 
                  AC_SUBST(COGL_GLES_VERSION, [COGL_HAS_GLES2])
 
201
                  AC_SUBST(COGL_GLES_VERSION, [COGL_HAS_GLES2])
194
202
 
195
203
                  AC_CHECK_HEADERS([EGL/egl.h],
196
204
                                   [],
202
210
                [fruity],
203
211
                [
204
212
                  clutter_gl_header="GLES/gl.h"
205
 
                  CLUTTER_COGL="gles"
 
213
                  COGL_DRIVER="gles"
206
214
                  AC_DEFINE([HAVE_COGL_GLES], 1, [Have GL/ES for rendering])
207
 
                  AC_SUBST(COGL_GLES_VERSION, [COGL_HAS_GLES1])
 
215
                  AC_SUBST(COGL_GLES_VERSION, [COGL_HAS_GLES1])
208
216
 
209
217
                  AC_CHECK_HEADERS([GLES/egl.h],
210
218
                                   [],
220
228
 
221
229
dnl === Clutter windowing system backend ======================================
222
230
 
223
 
AS_CASE([$clutterbackend],
224
 
 
225
 
        [sdl],
226
 
        [
227
 
          experimental_backend="yes"
228
 
          clutter_gl_header="GL/gl.h"
229
 
          CLUTTER_FLAVOUR="sdl"
230
 
          CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_SDL"
231
 
          AC_DEFINE([HAVE_CLUTTER_SDL], [1], [Have the SDL backend])
232
 
 
233
 
          CLUTTER_COGL="gl"
234
 
          AC_DEFINE([HAVE_COGL_GL], [1], [Have GL for rendering])
235
 
 
236
 
          AC_PATH_PROG(SDL_CONFIG, [sdl-config])
237
 
          AS_IF([test "x$SDL_CONFIG" = "x"],
238
 
                [AC_MSG_ERROR([No sdl-config binary found in path])],
239
 
                [
240
 
                  SDL_CFLAGS=`$SDL_CONFIG --cflags`
241
 
                  SDL_LIBS=`$SDL_CONFIG --libs`
242
 
 
243
 
                  AS_CASE([$host],
244
 
 
245
 
                          [*mingw32*],
246
 
                          [
247
 
                            # Use -lopengl32 under Windows instead of -lGL
248
 
                            SDL_LIBS="$SDL_LIBS -lopengl32"
249
 
                            CLUTTER_LT_LDFLAGS="$CLUTTER_LT_LDFLAGS -no-undefined"
250
 
                          ],
251
 
 
252
 
                          [
253
 
                            AC_CHECK_LIB(GL, [glEnable], [HAVE_LIBGL=yes], [HAVE_LIBGL=no])
254
 
                            AS_IF([test "x$HAVE_LIBGL" = "xno"], [AC_MSG_ERROR([libGL not found])])
255
 
                            SDL_LIBS="$SDL_LIBS -lGL"
256
 
                          ]
257
 
                  )
258
 
                ]
259
 
          )
260
 
        ],
 
231
AS_CASE([$CLUTTER_WINSYS],
261
232
 
262
233
        [glx],
263
234
        [
264
235
          clutter_gl_header="GL/gl.h"
265
 
          CLUTTER_FLAVOUR="glx"
266
236
          CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_GLX"
267
237
          AC_DEFINE([HAVE_CLUTTER_GLX], [1], [Have the GLX backend])
268
238
 
269
 
          CLUTTER_COGL="gl"
 
239
          COGL_DRIVER="gl"
270
240
          AC_DEFINE([HAVE_COGL_GL], [1], [Have GL for rendering])
271
241
 
272
242
          AC_CHECK_HEADERS([GL/glx.h],
280
250
          GLX_LIBS="$X11_LIBS -lGL"
281
251
          GLX_CFLAGS="$X11_CFLAGS"
282
252
 
283
 
          backendextra=x11
284
 
          backendextralib="x11/libclutter-x11.la"
 
253
          CLUTTER_WINSYS_BASE=x11
 
254
          CLUTTER_WINSYS_BASE_LIB="x11/libclutter-x11.la"
285
255
 
286
256
          # Mesa 7.3 added a GL pkg-config file, finally
287
257
          PKG_CHECK_EXISTS([gl], [BACKEND_PC_FILES="$BACKEND_PC_FILES gl"], [])
290
260
        [eglx],
291
261
        [
292
262
          # the GL header is defined in the COGL checks above
293
 
          CLUTTER_FLAVOUR="eglx"
294
263
          CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_EGL"
295
264
          AC_DEFINE([HAVE_CLUTTER_EGL], [1], [Have the EGL backend])
296
265
 
297
266
          EGL_LIBS="$GLES_LIBS $X11_LIBS"
298
267
          EGL_CFLAGS="$GLES_CFLAGS $X11_CFLAGS"
299
268
 
300
 
          backendextra=x11
301
 
          backendextralib="x11/libclutter-x11.la"
 
269
          CLUTTER_WINSYS_BASE=x11
 
270
          CLUTTER_WINSYS_BASE_LIB="x11/libclutter-x11.la"
302
271
 
303
272
          # Mesa 7.3 added a GL pkg-config file, finally
304
273
          PKG_CHECK_EXISTS([gl], [BACKEND_PC_FILES="$BACKEND_PC_FILES gl"], [])
307
276
        [eglnative],
308
277
        [
309
278
          # the GL header is defined in the COGL checks above
310
 
          CLUTTER_FLAVOUR="eglnative"
311
279
          CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_EGLNATIVE"
312
280
          AC_DEFINE([HAVE_CLUTTER_EGL], [1], [Have the EGL backend])
313
281
 
324
292
        [
325
293
          experimental_backend="yes"
326
294
          # the GL header is defined in the COGL checks above
327
 
          CLUTTER_FLAVOUR="fruity"
328
295
          CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_FRUITY"
329
296
          AC_DEFINE([HAVE_CLUTTER_FRUITY], [1], [Have the Fruity backend])
330
297
 
336
303
        [
337
304
          experimental_backend="yes"
338
305
          clutter_gl_header="OpenGL/gl.h"
339
 
          CLUTTER_FLAVOUR="osx"
340
306
          CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_OSX"
341
307
          AC_DEFINE([HAVE_CLUTTER_OSX], [1], [Have the OSX backend])
342
308
 
343
 
          CLUTTER_COGL="gl"
 
309
          COGL_DRIVER="gl"
344
310
          AC_DEFINE([HAVE_COGL_GL], [1], [Have GL for rendering])
345
311
 
346
312
          OSX_LIBS="-framework Cocoa -framework OpenGL"
349
315
        [win32],
350
316
        [
351
317
          clutter_gl_header="GL/gl.h"
352
 
          CLUTTER_FLAVOUR="win32"
353
318
          CLUTTER_STAGE_TYPE="CLUTTER_TYPE_STAGE_WIN32"
354
319
          AC_DEFINE([HAVE_CLUTTER_WIN32], [1], [Have the Win32 backend])
355
320
 
356
 
          CLUTTER_COGL="gl"
 
321
          COGL_DRIVER="gl"
357
322
          AC_DEFINE([HAVE_COGL_GL], [1], [Have GL for rendering])
358
323
 
359
324
          WIN32_CFLAGS="-D_WIN32_WINNT=0x0500"
360
325
          WIN32_LIBS="-lopengl32 -lgdi32 -lwinmm"
361
326
          CLUTTER_LT_LDFLAGS="$CLUTTER_LT_LDFLAGS -no-undefined"
 
327
 
 
328
          AC_CHECK_TOOL(WINDRES, windres, no)
 
329
          if test "$WINDRES" = no; then
 
330
             AC_MSG_ERROR([*** windres is required])
 
331
          fi
362
332
        ],
363
333
 
364
 
        [AC_MSG_ERROR([Invalid backend for Clutter: use glx, sdl, osx, win32, eglx, eglnative or fruity])]
 
334
        [AC_MSG_ERROR([Invalid backend for Clutter: use glx, osx, win32, eglx, eglnative or fruity])]
365
335
)
366
336
 
 
337
AM_CONDITIONAL(WINSYS_WIN32, [test "x$CLUTTER_WINSYS" = "xwin32"])
 
338
 
367
339
# at this point we must have a GL header to check
368
340
AS_IF([test "x$clutter_gl_header" = "x"], [AC_MSG_ERROR([Internal error: no GL header set])])
369
341
AC_CHECK_HEADERS([$clutter_gl_header],
372
344
 
373
345
CLUTTER_GL_HEADER=$clutter_gl_header
374
346
 
375
 
AC_SUBST([clutterbackend])
376
 
AC_SUBST([imagebackend])
377
 
AC_SUBST([backendextra])
378
 
AC_SUBST([backendextralib])
379
 
AC_SUBST(CLUTTER_FLAVOUR)
380
 
AC_SUBST(CLUTTER_COGL)
 
347
 
 
348
dnl === Clutter substitutions =================================================
 
349
# Eventually the idea of a winsys should be hidden from Clutter and moved
 
350
# into Cogl, but for now we have CLUTTER_WINSYS...
 
351
AC_SUBST([CLUTTER_WINSYS])
 
352
# The same goes for the winsys-base...
 
353
AC_SUBST([CLUTTER_WINSYS_BASE])
 
354
AC_SUBST([CLUTTER_WINSYS_BASE_LIB])
381
355
AC_SUBST(CLUTTER_GL_HEADER)
382
356
AC_SUBST(CLUTTER_STAGE_TYPE)
383
357
 
384
 
clutterbackendlib=libclutter-$clutterbackend-$CLUTTER_API_VERSION.la
385
 
AC_SUBST([clutterbackendlib])
 
358
CLUTTER_WINSYS_LIB=libclutter-$CLUTTER_WINSYS-$CLUTTER_API_VERSION.la
 
359
AC_SUBST([CLUTTER_WINSYS_LIB])
 
360
 
 
361
dnl === Clutter substitutions kept for backwards compatibility ================
 
362
CLUTTER_FLAVOUR=$CLUTTER_WINSYS
 
363
AC_SUBST([CLUTTER_FLAVOUR])
 
364
CLUTTER_COGL=$COGL_DRIVER
 
365
AC_SUBST([CLUTTER_COGL])
 
366
 
 
367
dnl === Cogl substitutions ====================================================
 
368
AC_SUBST([COGL_IMAGE_BACKEND])
 
369
COGL_WINSYS=$CLUTTER_WINSYS
 
370
AC_SUBST([COGL_WINSYS])
 
371
AC_SUBST([COGL_DRIVER])
386
372
 
387
373
dnl === Image loading backend =================================================
388
374
IMAGE_PC_FILES=""
389
375
 
390
 
# Peek which flavour the user wants so that we can couple the osx flavour with
 
376
# Peek which winsys the user wants so that we can couple the osx winsys with
391
377
# quartz imageloader.
392
 
AS_IF([test "x$with_flavour" = "xosx"], [imagebackend=quartz], [imagebackend=gdk-pixbuf])
 
378
AS_IF([test "x$COGL_WINSYS" = "xosx"], [COGL_IMAGE_BACKEND=quartz], [COGL_IMAGE_BACKEND=gdk-pixbuf])
393
379
 
394
380
AC_ARG_WITH([imagebackend],
395
381
            [AC_HELP_STRING([--with-imagebackend=@<:@gdk-pixbuf/quartz/internal@:>@],
396
382
                            [Select COGL image loading backend])],
397
 
            [imagebackend=$with_imagebackend])
 
383
            [COGL_IMAGE_BACKEND=$with_imagebackend])
398
384
 
399
 
AS_CASE([$imagebackend],
 
385
AS_CASE([$COGL_IMAGE_BACKEND],
400
386
 
401
387
        [quartz],
402
388
        [
423
409
X11_PC_FILES=""
424
410
x11_tests=no
425
411
 
426
 
AS_IF([test "x$clutterbackend" = "xglx" || test "x$clutterbackend" = "xeglx"],
 
412
AS_IF([test "x$CLUTTER_WINSYS" = "xglx" || test "x$CLUTTER_WINSYS" = "xeglx"],
427
413
      [
428
414
        # base X11 includes and libraries
429
415
        AC_MSG_CHECKING([for X11])
433
419
        AS_IF([test "x$have_x11" = "xyes"],
434
420
              [
435
421
                X11_PC_FILES="x11"
 
422
 
 
423
                # we actually need to ask for CFLAGS and LIBS
 
424
                X11_CFLAGS=`$PKG_CONFIG --cflags $X11_PC_FILES`
 
425
                X11_LIBS=`$PKG_CONFIG --libs $X11_PC_FILES`
 
426
 
436
427
                AC_MSG_RESULT([found])
437
428
              ],
438
429
              [
550
541
 
551
542
dnl === JSON parser check =====================================================
552
543
 
553
 
# allow building clutter with an external dependency on json-glib
554
 
# using the --with-json=check argument, but keep the default to
555
 
# the internal version
 
544
# we allow building clutter with the internal copy of json-glib
 
545
# for platforms without it, but by default we depend on the
 
546
# system copy
 
547
m4_define([default_json], [check])
556
548
AC_ARG_WITH([json],
557
 
            AC_HELP_STRING([--with-json=@<:@internal/check@:>@],
558
 
                           [Select the JSON-GLib copy to use @<:@default=internal@:>@]),
 
549
            AC_HELP_STRING([--with-json=@<:@internal/check/system@:>@],
 
550
                           [Select the JSON-GLib copy to use @<:@default=default_json@:>@]),
559
551
            [],
560
 
            [with_json=internal])
 
552
            [with_json=default_json])
561
553
 
562
554
AS_CASE([$with_json],
563
555
 
567
559
          have_json=no
568
560
        ],
569
561
 
 
562
        [system],
 
563
        [
 
564
          AC_MSG_CHECKING([for installed JSON-GLib])
 
565
          PKG_CHECK_EXISTS([json-glib-1.0 >= 0.8],
 
566
                           [have_json=yes],
 
567
                           [have_json=no])
 
568
          AS_IF([test "x$have_json" = "xyes"],
 
569
                [
 
570
                  JSON_PREFIX=json-glib
 
571
                  JSON_GLIB_PC="json-glib-1.0 >= 0.8"
 
572
 
 
573
                  AC_DEFINE([HAVE_JSON_GLIB],
 
574
                            [1],
 
575
                            [Have the JSON-GLib library installed])
 
576
 
 
577
                  AC_MSG_RESULT([found])
 
578
                ],
 
579
                [AC_MSG_ERROR([not found])]
 
580
          )
 
581
        ],
 
582
 
570
583
        [check],
571
584
        [
572
585
          AC_MSG_CHECKING([for installed JSON-GLib])
573
 
          PKG_CHECK_EXISTS([json-glib-1.0], [have_json=yes], [have_json=no])
 
586
          PKG_CHECK_EXISTS([json-glib-1.0 >= 0.8],
 
587
                           [have_json=yes],
 
588
                           [have_json=no])
574
589
          AS_IF([test "x$have_json" = "xyes"],
575
590
                [
576
591
                  JSON_PREFIX=json-glib
577
 
                  JSON_GLIB_PC=json-glib-1.0
 
592
                  JSON_GLIB_PC="json-glib-1.0 >= 0.8"
578
593
 
579
 
                  AC_DEFINE(HAVE_JSON_GLIB, 1, [Have the JSON-GLib library installed])
 
594
                  AC_DEFINE([HAVE_JSON_GLIB],
 
595
                            [1],
 
596
                            [Have the JSON-GLib library installed])
580
597
 
581
598
                  AC_MSG_RESULT([found])
582
599
                ],
593
610
AC_SUBST(JSON_PREFIX)
594
611
AM_CONDITIONAL(LOCAL_JSON_GLIB, test "x$have_json" = "xno")
595
612
 
596
 
dnl === Dependencies, compiler flags and linker libraries =====================
597
 
CLUTTER_REQUIRES="cairo >= 1.4 pangocairo >= 1.20 gobject-2.0 >= 2.16 gthread-2.0 gmodule-no-export-2.0 $IMAGE_PC_FILES $BACKEND_PC_FILES $JSON_GLIB_PC"
598
 
 
599
 
PKG_CHECK_MODULES(CLUTTER_DEPS, [$CLUTTER_REQUIRES])
600
 
 
601
 
AC_SUBST(CLUTTER_REQUIRES)
602
 
 
603
 
CLUTTER_CFLAGS="$SDL_CFLAGS $EGL_CFLAGS $GLX_CFLAGS $OSX_CFLAGS $WIN32_CFLAGS $CLUTTER_DEPS_CFLAGS"
604
 
CLUTTER_LIBS="$SDL_LIBS $EGL_LIBS $X11_LIBS $GLX_LIBS $OSX_LIBS $WIN32_LIBS $CLUTTER_DEPS_LIBS"
605
 
 
606
 
AC_SUBST(CLUTTER_CFLAGS)
607
 
AC_SUBST(CLUTTER_LIBS)
608
 
 
609
613
dnl === Enable debug level ====================================================
610
614
 
611
615
m4_define([debug_default], [m4_if(m4_eval(clutter_minor_version % 2), [1], [yes], [minimum])])
634
638
 
635
639
AC_SUBST(CLUTTER_DEBUG_CFLAGS)
636
640
 
637
 
m4_define([cogl_debug_default], [m4_if(m4_eval(clutter_minor_version % 2), [1], [minimum], [no])])
 
641
m4_define([cogl_debug_default], [minimum])
638
642
AC_ARG_ENABLE([cogl-debug],
639
643
              [AC_HELP_STRING([--enable-cogl-debug=@<:@no/yes@:>@],
640
644
                              [Control COGL debugging level @<:@default=cogl_debug_default@:>@])],
657
661
 
658
662
AC_SUBST(COGL_DEBUG_CFLAGS)
659
663
 
 
664
dnl === Conformance test suite ================================================
 
665
 
 
666
AC_ARG_ENABLE([conformance],
 
667
              [AC_HELP_STRING([--enable-conformance=@<:@no/yes@:>@],
 
668
                              [Build conformance test suite @<:@default=yes@:>@])],
 
669
              [],
 
670
              [enable_conformance=yes])
 
671
 
 
672
AM_CONDITIONAL([BUILD_TESTS], [test "x$enable_conformance" = "xyes"])
 
673
 
 
674
dnl === Profiling =============================================================
 
675
 
 
676
m4_define([profile_default], [no])
 
677
AC_ARG_ENABLE(profile,
 
678
              AC_HELP_STRING([--enable-profile=@<:@no/yes@:>@],
 
679
                             [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@:>@]),
 
680
              [],
 
681
              [enable_profile=profile_default])
 
682
 
 
683
AS_CASE([$enable_profile],
 
684
 
 
685
        [yes],
 
686
        [
 
687
          AS_IF([test "x$GCC" = "xyes"],
 
688
                [
 
689
                  PKG_CHECK_MODULES([PROFILE_DEP], [uprof-0.2])
 
690
                  CLUTTER_PROFILE_CFLAGS=" -DCLUTTER_ENABLE_PROFILE -DCOGL_ENABLE_PROFILE $PROFILE_DEP_CFLAGS"
 
691
                  CLUTTER_PROFILE_LDFLAGS=" $PROFILE_DEP_LIBS"
 
692
 
 
693
                  AS_IF([test "x$enable_debug" = "xyes"], [CLUTTER_PROFILE_CFLAGS+=" -DUPROF_DEBUG"])
 
694
                ],
 
695
                [
 
696
                  AC_MSG_ERROR([--enable-profile is currently only supported if using GCC])
 
697
                ])
 
698
        ],
 
699
 
 
700
        [no],
 
701
        [
 
702
          CLUTTER_PROFILE_CFLAGS=""
 
703
          CLUTTER_PROFILE_LDFLAGS=""
 
704
        ],
 
705
 
 
706
        [*], [AC_MSG_ERROR([Invalid value for --enable-profile])]
 
707
)
 
708
AM_CONDITIONAL(PROFILE, test "x$enable_profile" != "xno")
 
709
AC_SUBST(CLUTTER_PROFILE_CFLAGS)
 
710
AC_SUBST(CLUTTER_PROFILE_LDFLAGS)
 
711
 
 
712
dnl === Coverage report =======================================================
 
713
 
 
714
AC_PATH_PROG([GCOV], [gcov], [enable_gcov=no])
 
715
 
 
716
AC_MSG_CHECKING([whether to build with gcov testing])
 
717
 
 
718
AC_ARG_ENABLE([gcov],
 
719
              [AS_HELP_STRING([--enable-gcov],
 
720
                              [Whether to enable coverage testing (requires gcc
 
721
and gcov)])],
 
722
              [],
 
723
              [enable_gcov=no])
 
724
 
 
725
AS_IF([test "x$enable_gcov" = "xyes" && test "x$GCC" = "xyes"],
 
726
      [
 
727
        AS_IF([test "x$enable_conformance" = "xno"],
 
728
              [AC_MSG_WARN([Conformance test suite is disabled, the coverage report will be incomplete])],
 
729
              [AC_MSG_RESULT([yes])]
 
730
        )
 
731
 
 
732
        GCOV_CFLAGS="-g -O0 -fprofile-arcs -ftest-coverage"
 
733
        GCOV_LDFLAGS="-lgcov"
 
734
      ],
 
735
      [AC_MSG_RESULT([no])]
 
736
)
 
737
 
 
738
AM_CONDITIONAL([GCOV_ENABLED], [test "x$enable_gcov" = "xyes"])
 
739
AC_SUBST([GCOV_CFLAGS])
 
740
AC_SUBST([GCOV_LDFLAGS])
 
741
 
660
742
dnl === Enable strict compiler flags ==========================================
661
743
 
662
744
# use strict compiler flags only on development releases
670
752
AS_IF([test "x$enable_maintainer_flags" = "xyes" && test "x$GCC" = "xyes"],
671
753
      [
672
754
        AS_COMPILER_FLAGS([MAINTAINER_CFLAGS],
673
 
                          ["-Wall -Wshadow -Wcast-align -Wno-uninitialized
674
 
                            -Wno-strict-aliasing -Wempty-body -Wformat-security
675
 
                            -Winit-self"])
 
755
                          ["-Wall -Wshadow -Wcast-align -Wuninitialized
 
756
                            -Wno-strict-aliasing -Wempty-body -Wformat
 
757
                            -Wformat-security -Winit-self"])
676
758
      ]
677
759
)
678
760
 
679
761
AC_SUBST(MAINTAINER_CFLAGS)
680
762
 
 
763
dnl === Dependencies, compiler flags and linker libraries =====================
 
764
CLUTTER_REQUIRES="cairo >= 1.4 pangocairo >= 1.20 gobject-2.0 >= 2.16 gthread-2.0 gmodule-no-export-2.0 $IMAGE_PC_FILES $BACKEND_PC_FILES $JSON_GLIB_PC"
 
765
 
 
766
PKG_CHECK_MODULES(CLUTTER_DEPS, [$CLUTTER_REQUIRES])
 
767
 
 
768
AC_SUBST(CLUTTER_REQUIRES)
 
769
 
 
770
CLUTTER_CFLAGS="$SDL_CFLAGS $EGL_CFLAGS $GLX_CFLAGS $OSX_CFLAGS $WIN32_CFLAGS $CLUTTER_DEPS_CFLAGS $CLUTTER_PROFILE_CFLAGS"
 
771
CLUTTER_LIBS="$SDL_LIBS $EGL_LIBS $X11_LIBS $GLX_LIBS $OSX_LIBS $WIN32_LIBS $CLUTTER_DEPS_LIBS $CLUTTER_PROFILE_LDFLAGS"
 
772
 
 
773
AC_SUBST(CLUTTER_CFLAGS)
 
774
AC_SUBST(CLUTTER_LIBS)
 
775
 
681
776
dnl === GObject-Introspection check ===========================================
682
777
 
683
778
GOBJECT_INTROSPECTION_CHECK([0.6.4])
706
801
 
707
802
dnl === Manual ================================================================
708
803
 
709
 
AC_ARG_ENABLE([manual],
710
 
              [AC_HELP_STRING([--enable-manual=@<:@no/yes@:>@],
711
 
                              [Build application developers manual. Requires jw and xmlto.])],
712
 
              [enable_manual=$enableval],
713
 
              [enable_manual=no])
 
804
AC_ARG_ENABLE([docs],
 
805
              [AC_HELP_STRING([--enable-docs=@<:@no/yes@:>@],
 
806
                              [Build optional documentation; requires xsltproc and jw.])],
 
807
              [enable_docs=$enableval],
 
808
              [enable_docs=no])
714
809
 
715
 
AS_IF([test "x$enable_manual" = "xyes"],
 
810
enable_pdfs=no
 
811
AS_IF([test "x$enable_docs" = "xyes"],
716
812
      [
717
813
        AC_PATH_PROG(JW, [jw], [no])
718
814
        AS_IF([test "x$JW" = "xno"],
719
 
              [AC_MSG_ERROR(['jw' program needed by the manual not found in path])]
720
 
        )
 
815
              [
 
816
                AC_MSG_WARN([jw not found; pdf generation has been disabled])
 
817
              ],
 
818
              [enable_pdfs=yes])
721
819
 
722
 
        AC_PATH_PROG(XMLTO, [xmlto], [no])
723
 
        AS_IF([test "x$XMLTO" = "xno"],
724
 
              [AC_MSG_ERROR(['xmlto' program needed by the manual not found in path])]
725
 
        )
 
820
        AC_PATH_PROG(XSLTPROC, [xsltproc], [no])
 
821
        AS_IF([test "x$XSLTPROC" = "xno"],
 
822
              [
 
823
                AC_MSG_ERROR([xsltproc not found])
 
824
              ])
726
825
      ]
727
826
)
728
827
 
729
 
AM_CONDITIONAL(ENABLE_MANUAL, [test "x$enable_manual" = "xyes"])
 
828
AM_CONDITIONAL(ENABLE_DOCS, [test "x$enable_docs" = "xyes"])
 
829
AM_CONDITIONAL(ENABLE_PDFS, [test "x$enable_pdfs" = "xyes"])
730
830
 
731
831
dnl === I18N ==================================================================
732
832
 
743
843
dnl ===========================================================================
744
844
 
745
845
m4_ifdef([AM_SILENT_RULES],
746
 
         [
 
846
         [
747
847
           AM_SILENT_RULES([yes])
748
848
           use_shave=no
749
849
         ],
750
 
         [
 
850
         [
751
851
           SHAVE_INIT([build/autotools], [enable])
752
852
           AC_CONFIG_FILES([
753
853
                build/autotools/shave
762
862
        Makefile
763
863
        build/Makefile
764
864
        build/autotools/Makefile
 
865
        build/mingw/Makefile
765
866
        clutter/Makefile
766
867
        clutter/clutter-version.h
767
868
        clutter/clutter-json.h
774
875
        clutter/osx/Makefile
775
876
        clutter/win32/Makefile
776
877
        clutter/win32/clutter-win32.pc
777
 
        clutter/sdl/Makefile
778
878
        clutter/cogl/Makefile
779
 
        clutter/cogl/common/Makefile
780
 
        clutter/cogl/cogl.h
781
 
        clutter/cogl/cogl-defines-gl.h:clutter/cogl/gl/cogl-defines.h.in
782
 
        clutter/cogl/cogl-defines-gles.h:clutter/cogl/gles/cogl-defines.h.in
783
 
        clutter/cogl/cogl.pc
784
 
        clutter/cogl/gl/Makefile
785
 
        clutter/cogl/gles/Makefile
 
879
        clutter/cogl/cogl/Makefile
 
880
        clutter/cogl/cogl/driver/gl/cogl-defines.h
 
881
        clutter/cogl/cogl/driver/gles/cogl-defines.h
 
882
        clutter/cogl/cogl/cogl.pc
 
883
        clutter/cogl/cogl/driver/Makefile
 
884
        clutter/cogl/cogl/driver/gl/Makefile
 
885
        clutter/cogl/cogl/driver/gles/Makefile
 
886
        clutter/cogl/pango/Makefile
786
887
        clutter/json/Makefile
787
 
        clutter/pango/Makefile
788
888
        tests/Makefile
789
889
        tests/conform/Makefile
790
890
        tests/data/Makefile
797
897
        doc/reference/clutter/clutter-docs.xml
798
898
        doc/reference/cogl/Makefile
799
899
        doc/reference/cogl/cogl-docs.xml
 
900
        doc/common/Makefile
 
901
        doc/manual/Makefile
800
902
        doc/manual/clutter-manual.xml
801
 
        doc/manual/Makefile
 
903
        doc/cookbook/Makefile
 
904
        doc/cookbook/clutter-cookbook.xml
802
905
        po/Makefile.in
803
906
        clutter.pc
804
907
])
808
911
dnl === Summary ===============================================================
809
912
 
810
913
echo ""
811
 
echo "                     Clutter    $VERSION"
812
 
echo "                   ===================="
813
 
echo ""
814
 
echo "                      prefix:   ${prefix}"
815
 
echo ""
816
 
echo "                     Flavour:   ${clutterbackend}/${CLUTTER_COGL}"
817
 
if test "x$clutterbackend" = "xeglx" || test "x$clutterbackend" = "xglx"; then
818
 
  echo "                      XInput:   ${xinput}"
819
 
fi
820
 
echo "                  GL headers:   ${CLUTTER_GL_HEADER}"
821
 
echo "               Image backend:   ${imagebackend}"
822
 
echo "              Target library:   ${clutterbackendlib}"
823
 
echo "         Clutter debug level:   ${enable_debug}"
824
 
echo "            COGL debug level:   ${enable_cogl_debug}"
825
 
echo "              Compiler flags:   ${CPPFLAGS} ${MAINTAINER_CFLAGS}"
826
 
echo "     Build API documentation:   ${enable_gtk_doc}"
827
 
echo "  Build manual documentation:   ${enable_manual}"
828
 
echo "    Build introspection data:   ${enable_introspection}"
829
 
echo ""
830
 
 
831
 
# you can add more configuration options or flags that will bring up the
832
 
# the experimental/unstable warning summary.
833
 
 
834
 
if test "x$experimental_backend" = "xyes"; then
835
 
  experimental_stuff="$experimental_stuff   Clutter backend:  ${clutterbackend}\n"
836
 
fi
837
 
 
838
 
if test "x$experimental_image" = "xyes"; then
839
 
  experimental_stuff="$experimental_stuff     Image backend:  ${imagebackend}\n"
840
 
fi
841
 
 
842
 
if test "x$experimental_stuff" != "x"; then
843
 
  echo ""
844
 
  echo "☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠"
845
 
  echo " *WARNING*"
846
 
  echo ""
847
 
  echo "  The stability of your build might be affected by one or more"
848
 
  echo "  experimental backends or experimental and unsupported features:"
849
 
  echo ""
850
 
  echo -e "$experimental_stuff"
851
 
  echo "☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠"
852
 
  echo ""
 
914
echo "Clutter - $VERSION (${CLUTTER_RELEASE_STATUS})"
 
915
 
 
916
# Global flags
 
917
echo ""
 
918
echo " • Global:"
 
919
echo "        Prefix: ${prefix}"
 
920
echo "        Flavour: ${CLUTTER_WINSYS}/${COGL_DRIVER}"
 
921
echo "        Target library: ${CLUTTER_WINSYS_LIB}"
 
922
 
 
923
# Compiler/Debug related flags
 
924
echo ""
 
925
echo " • Compiler options:"
 
926
echo "        Clutter debug level: ${enable_debug}"
 
927
echo "        COGL debug level: ${enable_cogl_debug}"
 
928
echo "        Compiler flags: ${MAINTAINER_CFLAGS}"
 
929
echo "        Profiling enabled: ${enable_profile}"
 
930
echo "        Enable coverage tests: ${enable_gcov}"
 
931
 
 
932
# Documentation
 
933
echo ""
 
934
echo " • Documentation:"
 
935
echo "        Build API Reference: ${enable_gtk_doc}"
 
936
echo "        Build Additional Documentation: ${enable_docs} (Generate PDF: ${enable_pdfs})"
 
937
 
 
938
# Miscellaneous
 
939
echo ""
 
940
echo " • Extra:"
 
941
echo "        Build introspection data: ${enable_introspection}"
 
942
echo "        Build conformance test suite: ${enable_conformance}"
 
943
 
 
944
if test "x$have_json" = "xyes"; then
 
945
echo "        JSON-GLib: system"
 
946
else
 
947
echo "        JSON-GLib: internal"
 
948
fi
 
949
 
 
950
# COGL flags
 
951
echo ""
 
952
echo " • COGL Backend:"
 
953
echo "        Driver: ${COGL_DRIVER}"
 
954
echo "        GL header: ${CLUTTER_GL_HEADER}"
 
955
 
 
956
if test "x$COGL_DRIVER" = "xgles"; then
 
957
  if test "x$use_gles2_wrapper" = "xyes"; then
 
958
echo "        GLES version: 2.0"
 
959
  else
 
960
echo "        GLES version: 1.1"
 
961
  fi
 
962
fi
 
963
 
 
964
if test "x$experimental_image" = "xno"; then
 
965
echo "        Image backend: ${COGL_IMAGE_BACKEND}"
 
966
else
 
967
echo "        Image backend: ${COGL_IMAGE_BACKEND} (WARNING: Experimental)"
 
968
fi
 
969
 
 
970
# Clutter backend related flags
 
971
echo ""
 
972
echo " • Clutter Backend:"
 
973
 
 
974
if test "x$experimental_backend" = "xno"; then
 
975
echo "        Windowing system: ${CLUTTER_WINSYS}"
 
976
else
 
977
echo "        Windowing system: ${CLUTTER_WINSYS} (WARNING: Experimental)"
 
978
fi
 
979
 
 
980
if test "x$CLUTTER_WINSYS" = "xglx" ||
 
981
   test "x$CLUTTER_WINSYS" = "xeglx"; then
 
982
echo "        Enable XInput 1.0: ${xinput}"
 
983
echo "        Enable X11 tests: ${x11_tests}"
 
984
fi
 
985
 
 
986
echo ""
 
987
 
 
988
# General warning about experimental features
 
989
if test "x$experimental_backend" = "xyes" ||
 
990
   test "x$experimental_image" = "xyes"; then
 
991
echo ""
 
992
echo "☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠"
 
993
echo " *WARNING*"
 
994
echo ""
 
995
echo "  The stability of your build might be affected by one or more"
 
996
echo "  experimental backends or experimental and unsupported features"
 
997
echo "☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠"
 
998
echo ""
853
999
fi