~elementary-os/elementaryos/os-patch-mutter-bionic

« back to all changes in this revision

Viewing changes to cogl/configure.ac

  • Committer: RabbitBot
  • Date: 2018-04-11 14:49:36 UTC
  • Revision ID: rabbitbot@elementary.io-20180411144936-hgymqa9d8d1xfpbh
Initial import, version 3.28.0-2

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
AC_PREREQ(2.59)
 
2
 
 
3
dnl ================================================================
 
4
dnl XXX: If you are making a release then you need to check these
 
5
dnl sections:
 
6
dnl » API versions (Only the 1.x version needs to change)
 
7
dnl   (the pretty numbers that the users see)
 
8
dnl
 
9
dnl » Interface version details for libtool
 
10
dnl   (the shared library versioning information)
 
11
dnl
 
12
dnl » Source code release status
 
13
dnl   (mark the source code as being part of a "release" or from "git")
 
14
dnl ================================================================
 
15
 
 
16
dnl ================================================================
 
17
dnl API versions (i.e. the pretty numbers that users see)
 
18
dnl ================================================================
 
19
m4_define([cogl_major_version], [2])
 
20
m4_define([cogl_minor_version], [0])
 
21
m4_define([cogl_micro_version], [0])
 
22
m4_define([cogl_version],
 
23
          [cogl_major_version.cogl_minor_version.cogl_micro_version])
 
24
 
 
25
dnl Since the core Cogl library has to also maintain support for the
 
26
dnl Cogl 1.x API for Clutter then we track the 1.x version separately.
 
27
m4_define([cogl_1_minor_version], [22])
 
28
m4_define([cogl_1_micro_version], [1])
 
29
m4_define([cogl_1_version], [1.cogl_1_minor_version.cogl_1_micro_version])
 
30
 
 
31
dnl ================================================================
 
32
dnl Interface version details for libtool
 
33
dnl ================================================================
 
34
# Note: we don't automatically deduce the libtool version info from
 
35
# the pretty version number that users sees. This is because we want
 
36
# to update the pretty version number before making a release since it
 
37
# can affect the name of our pkg-config file and the naming or
 
38
# location of other installed files which we want to be able to verify
 
39
# as correct well before making a release.
 
40
#
 
41
# For reference on how the various numbers should be updated at
 
42
# release time these rules are adapted from the libtool info pages:
 
43
#
 
44
#  1. Update the version information only immediately before a public
 
45
#     release.
 
46
#
 
47
#  2. If the library source code has changed at all since the last
 
48
#     update, then increment REVISION (`C:R:A' becomes `C:r+1:A').
 
49
#
 
50
#  3. If any interfaces have been added, removed, or changed since the
 
51
#     last update, increment CURRENT, and set REVISION to 0.
 
52
#
 
53
#  4. If any interfaces have been added since the last public release,
 
54
#     then increment AGE.
 
55
#
 
56
#  5. If any interfaces have been removed since the last public release,
 
57
#     then set AGE to 0.
 
58
m4_define([cogl_lt_current], 24)
 
59
m4_define([cogl_lt_revision], 1)
 
60
m4_define([cogl_lt_age], 4)
 
61
# We do also tell libtool the pretty version:
 
62
m4_define([cogl_lt_release], [cogl_version])
 
63
 
 
64
 
 
65
dnl ================================================================
 
66
dnl Source code release status
 
67
dnl ================================================================
 
68
# Finally we explicitly track when we are building development source
 
69
# from Git vs building source corresponding to a release. As with the
 
70
# libtool version info we don't automatically derive this from the
 
71
# pretty version number because we want to test the results of
 
72
# updating the version number in advance of a release.
 
73
#
 
74
# Possible status values are: git, snapshot or release
 
75
#
 
76
m4_define([cogl_release_status], [git])
 
77
 
 
78
AC_INIT(cogl, [cogl_1_version])
 
79
AC_CONFIG_SRCDIR(cogl/cogl.h)
 
80
AC_CONFIG_AUX_DIR([build])
 
81
AC_CONFIG_MACRO_DIR([build/autotools])
 
82
AC_CONFIG_HEADERS(cogl-config.h)
 
83
AC_CONFIG_HEADERS(cogl-mutter-config.h)
 
84
AC_GNU_SOURCE
 
85
 
 
86
dnl ================================================================
 
87
dnl Check that we are configured by mutter
 
88
dnl ================================================================
 
89
 
 
90
AC_ARG_VAR([MUTTER_VERSION])
 
91
AC_ARG_VAR([LIBMUTTER_API_VERSION])
 
92
 
 
93
AS_IF([test "x$MUTTER_VERSION" = "x"],
 
94
      [AC_MSG_ERROR([Clutter can only be configured by mutter])],)
 
95
 
 
96
dnl ================================================================
 
97
dnl Required versions for dependencies
 
98
dnl ================================================================
 
99
m4_define([glib_req_version],           [2.32.0])
 
100
m4_define([pangocairo_req_version],     [1.20])
 
101
m4_define([gi_req_version],             [0.9.5])
 
102
m4_define([gdk_pixbuf_req_version],     [2.0])
 
103
m4_define([uprof_req_version],          [0.3])
 
104
m4_define([xfixes_req_version],         [3])
 
105
m4_define([xcomposite_req_version],     [0.4])
 
106
m4_define([xrandr_req_version],         [1.2])
 
107
m4_define([cairo_req_version],          [1.10])
 
108
m4_define([wayland_server_req_version], [1.1.90])
 
109
m4_define([mirclient_req_version],      [0.9.0])
 
110
 
 
111
dnl These variables get copied into the generated README
 
112
AC_SUBST([GLIB_REQ_VERSION], [glib_req_version])
 
113
AC_SUBST([GDK_PIXBUF_REQ_VERSION], [gdk_pixbuf_req_version])
 
114
AC_SUBST([CAIRO_REQ_VERSION], [cairo_req_version])
 
115
AC_SUBST([PANGOCAIRO_REQ_VERSION], [pangocairo_req_version])
 
116
AC_SUBST([XCOMPOSITE_REQ_VERSION], [xcomposite_req_version])
 
117
AC_SUBST([XFIXES_REQ_VERSION], [xfixes_req_version])
 
118
AC_SUBST([GI_REQ_VERSION], [gi_req_version])
 
119
AC_SUBST([UPROF_REQ_VERSION], [uprof_req_version])
 
120
AC_SUBST([WAYLAND_SERVER_REQ_VERSION], [wayland_server_req_version])
 
121
 
 
122
# Save this value here, since automake will set cflags later and we
 
123
# want to know if the user specified custom cflags or not.
 
124
cflags_set=${CFLAGS+set}
 
125
 
 
126
AM_INIT_AUTOMAKE([1.14 foreign -Wno-portability no-define no-dist-gzip dist-xz tar-ustar subdir-objects])
 
127
AM_SILENT_RULES([yes])
 
128
 
 
129
AH_BOTTOM([#include "config-custom.h"])
 
130
 
 
131
dnl ================================================================
 
132
dnl Export the API versioning
 
133
dnl ================================================================
 
134
AC_SUBST([COGL_MAJOR_VERSION],[cogl_major_version])
 
135
AC_SUBST([COGL_MINOR_VERSION],[cogl_minor_version])
 
136
AC_SUBST([COGL_MICRO_VERSION],[cogl_micro_version])
 
137
AC_SUBST([COGL_VERSION],[cogl_version])
 
138
AC_SUBST([COGL_API_VERSION],[cogl_major_version.0])
 
139
AC_SUBST([COGL_API_VERSION_AM],[$COGL_MAJOR_VERSION\_0])
 
140
 
 
141
AC_SUBST([COGL_1_MINOR_VERSION],[cogl_1_minor_version])
 
142
AC_SUBST([COGL_1_MICRO_VERSION],[cogl_1_micro_version])
 
143
AC_SUBST([COGL_1_VERSION],[cogl_1_version])
 
144
 
 
145
 
 
146
dnl ================================================================
 
147
dnl Export the libtool versioning
 
148
dnl ================================================================
 
149
AC_SUBST([COGL_LT_CURRENT], [cogl_lt_current])
 
150
AC_SUBST([COGL_LT_REVISION], [cogl_lt_revision])
 
151
AC_SUBST([COGL_LT_AGE], [cogl_lt_age])
 
152
AC_SUBST([COGL_LT_RELEASE], [cogl_lt_release])
 
153
 
 
154
 
 
155
dnl ================================================================
 
156
dnl Export the source code release status
 
157
dnl ================================================================
 
158
AC_SUBST([COGL_RELEASE_STATUS], [cogl_release_status])
 
159
 
 
160
dnl ================================================================
 
161
dnl Compiler stuff.
 
162
dnl ================================================================
 
163
AC_PROG_CC
 
164
AC_PROG_CPP
 
165
AC_PROG_CXX
 
166
AM_PROG_CC_C_O
 
167
AC_ISC_POSIX
 
168
AC_C_CONST
 
169
 
 
170
dnl     ============================================================
 
171
dnl     Compiler features
 
172
dnl     ============================================================
 
173
AC_MSG_CHECKING([for _Static_assert])
 
174
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([_Static_assert (1, "");],
 
175
                                   [(void) 0])],
 
176
                  [AC_DEFINE([HAVE_STATIC_ASSERT], [1],
 
177
                             [Whether _Static_assert can be used or not])
 
178
                   AC_MSG_RESULT([yes])],
 
179
                  [AC_MSG_RESULT([no])])
 
180
 
 
181
dnl ================================================================
 
182
dnl Libtool stuff.
 
183
dnl ================================================================
 
184
dnl AC_PROG_LIBTOOL
 
185
dnl LIBTOOL="$LIBTOOL --preserve-dup-deps"
 
186
LT_PREREQ([2.2.6])
 
187
LT_INIT([disable-static])
 
188
dnl when using libtool 2.x create libtool early, because it's used in the
 
189
dnl internal glib configure (as-glibconfig.m4)
 
190
m4_ifdef([LT_OUTPUT], [LT_OUTPUT])
 
191
 
 
192
dnl ================================================================
 
193
dnl Find an appropriate libm, for sin() etc.
 
194
dnl ================================================================
 
195
LT_LIB_M
 
196
AC_SUBST(LIBM)
 
197
 
 
198
dnl ================================================================
 
199
dnl See what platform we are building for
 
200
dnl ================================================================
 
201
AC_CANONICAL_HOST
 
202
 
 
203
dnl     ============================================================
 
204
dnl     Installed tests
 
205
dnl     ============================================================
 
206
 
 
207
AC_ARG_ENABLE(installed_tests,
 
208
              AS_HELP_STRING([--enable-installed-tests],
 
209
                             [Install test programs (default: no)]),,
 
210
              [enable_installed_tests=no])
 
211
AM_CONDITIONAL(ENABLE_INSTALLED_TESTS, test x$enable_installed_tests = xyes)
 
212
 
 
213
dnl     ============================================================
 
214
dnl     Enable debugging
 
215
dnl     ============================================================
 
216
m4_define([debug_default], [m4_if(cogl_release_status, [git], [yes], [no])])
 
217
AC_ARG_ENABLE(
 
218
  [debug],
 
219
  [AC_HELP_STRING([--enable-debug=@<:@no/yes@:>@], [Control Cogl debugging level @<:@default=]debug_default[@:>@])],
 
220
  [],
 
221
  enable_debug=debug_default
 
222
)
 
223
AS_CASE(
 
224
  [$enable_debug],
 
225
  [yes],
 
226
  [
 
227
    test "$cflags_set" = set || CFLAGS="$CFLAGS -g -O0"
 
228
    COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS -DCOGL_GL_DEBUG -DCOGL_OBJECT_DEBUG -DCOGL_ENABLE_DEBUG"
 
229
  ],
 
230
  [no],
 
231
  [
 
232
    COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
 
233
  ],
 
234
  [AC_MSG_ERROR([Unknown argument for --enable-debug])]
 
235
)
 
236
 
 
237
AC_SUBST(COGL_DEBUG_CFLAGS)
 
238
 
 
239
AC_ARG_ENABLE(
 
240
  [unit-tests],
 
241
  [AC_HELP_STRING([--enable-unit-tests=@<:@no/yes@:>@], [Build Cogl unit tests @<:@default=yes@:>@])],
 
242
  [],
 
243
  enable_unit_tests=yes
 
244
)
 
245
AS_IF([test "x$enable_unit_tests" = "xyes"],
 
246
      [
 
247
        AC_DEFINE([ENABLE_UNIT_TESTS], [1], [Whether to enable building unit tests])
 
248
      ]
 
249
)
 
250
AM_CONDITIONAL(UNIT_TESTS, test "x$enable_unit_tests" = "xyes")
 
251
 
 
252
dnl     ============================================================
 
253
dnl     Enable cairo usage for debugging
 
254
dnl       (debugging code can use cairo to dump the atlas)
 
255
dnl     ============================================================
 
256
 
 
257
PKG_CHECK_EXISTS([CAIRO], [cairo >= cairo_req_version], [have_cairo=yes])
 
258
AC_ARG_ENABLE(
 
259
  [cairo],
 
260
  [AC_HELP_STRING([--enable-cairo=@<:@no/yes@:>@], [Control Cairo usage in Cogl debugging code @<:@default=auto@:>@])],
 
261
  [],
 
262
  [
 
263
    AS_IF([test "x$enable_debug" = "xyes"],
 
264
          [enable_cairo=$have_cairo],
 
265
          [enable_cairo=no])
 
266
  ]
 
267
)
 
268
AS_IF([test "x$enable_cairo" = "xyes" && test "x$enable_debug" = "xyes"],
 
269
      [
 
270
        AS_IF([test "x$have_cairo" != "xyes"],
 
271
              [AC_MSG_ERROR([Could not find Cairo])])
 
272
 
 
273
        COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES cairo >= cairo_req_version"
 
274
        AC_DEFINE([HAVE_CAIRO], [1], [Whether we have cairo or not])
 
275
      ])
 
276
 
 
277
 
 
278
dnl     ============================================================
 
279
dnl     Enable profiling
 
280
dnl     ============================================================
 
281
AC_ARG_ENABLE(profile,
 
282
              [AC_HELP_STRING([--enable-profile=@<:@no/yes@:>@],
 
283
                             [Turn on uprof profiling support. yes; All UProf profiling probe points are compiled in and may be runtime enabled. no; No profiling support will built into cogl.  @<:@default=no@:>@])],
 
284
              [],
 
285
              [enable_profile=no])
 
286
AS_IF([test "x$enable_profile" = "xyes"],
 
287
      [
 
288
        AS_IF([test "x$GCC" = "xyes"],
 
289
              [
 
290
                COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES uprof-0.3"
 
291
                COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS -DCOGL_ENABLE_PROFILE"
 
292
                AS_IF([test "x$enable_debug" = "xyes"], [COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS -DUPROF_DEBUG"])
 
293
              ],
 
294
              [
 
295
                AC_MSG_ERROR([--enable-profile is currently only supported if using GCC])
 
296
              ])
 
297
      ])
 
298
AM_CONDITIONAL(PROFILE, test "x$enable_profile" != "xno")
 
299
 
 
300
 
 
301
dnl     ============================================================
 
302
dnl     Enable strict compiler flags
 
303
dnl     ============================================================
 
304
 
 
305
# use strict compiler flags only when building from git; the rules for
 
306
# distcheck will take care of turning this on when making a release
 
307
m4_define([maintainer_default], [m4_if(cogl_release_status, [git], [yes], [no])])
 
308
AC_ARG_ENABLE(
 
309
  [maintainer-flags],
 
310
  [AC_HELP_STRING([--enable-maintainer-flags=@<:@no/yes/error@:>@], [Use strict compiler flags @<:@default=]maintainer_default[@:>@])],
 
311
  [],
 
312
  enable_maintainer_flags=maintainer_default
 
313
)
 
314
 
 
315
MAINTAINER_COMPILER_FLAGS="-Wall -Wcast-align -Wformat -Wformat-security
 
316
                           -Werror=uninitialized -Werror=no-strict-aliasing
 
317
                           -Werror=empty-body -Werror=init-self -Werror=undef
 
318
                           -Werror=declaration-after-statement -Werror=vla
 
319
                           -Werror=pointer-arith -Werror=missing-declarations
 
320
                           -Werror=maybe-uninitialized"
 
321
 
 
322
AS_CASE(
 
323
  [$enable_maintainer_flags],
 
324
  [yes],
 
325
  [
 
326
    AS_COMPILER_FLAGS([MAINTAINER_CFLAGS], [$MAINTAINER_COMPILER_FLAGS])
 
327
  ],
 
328
  [no],
 
329
  [
 
330
  ],
 
331
  [error],
 
332
  [
 
333
    MAINTAINER_COMPILER_FLAGS="$MAINTAINER_COMPILER_FLAGS -Werror"
 
334
    AS_COMPILER_FLAGS([MAINTAINER_CFLAGS], [$MAINTAINER_COMPILER_FLAGS])
 
335
  ],
 
336
  [*],
 
337
  [AC_MSG_ERROR([Invalid option for --enable-maintainer-flags])]
 
338
)
 
339
 
 
340
# strip leading spaces
 
341
COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS ${MAINTAINER_CFLAGS#*  }"
 
342
COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS -Wno-error=sign-compare"
 
343
 
 
344
 
 
345
dnl     ============================================================
 
346
dnl     Enable deprecation guards
 
347
dnl     ============================================================
 
348
 
 
349
# disable deprecated options from Glib only when building from git;
 
350
# the rules for distcheck will take care of turning this on when
 
351
# making a release
 
352
m4_define([deprecated_default],
 
353
          [m4_if(cogl_release_status, [git], [no], [yes])])
 
354
 
 
355
AC_ARG_ENABLE([deprecated],
 
356
              [AS_HELP_STRING([--enable-deprecated=@<:@no/yes@:>@],
 
357
                              [Whether deprecated symbols should be disabled when compiling Cogl @<:@default=]deprecated_default[@:>@])],
 
358
              [],
 
359
              [enable_deprecated=deprecated_default])
 
360
 
 
361
AS_CASE([$enable_deprecated],
 
362
 
 
363
        [no],
 
364
        [
 
365
          DEPRECATED_CFLAGS="-DG_DISABLE_DEPRECATED -DG_DISABLE_SINGLE_INCLUDES"
 
366
        ],
 
367
 
 
368
        [yes],
 
369
        [
 
370
          DEPRECATED_CFLAGS=""
 
371
        ],
 
372
 
 
373
        [AC_MSG_ERROR([Unknown argument for --enable-deprecated])]
 
374
)
 
375
 
 
376
# strip leading spaces
 
377
COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS ${DEPRECATED_CFLAGS#*  }"
 
378
 
 
379
dnl ================================================================
 
380
dnl Check for dependency packages.
 
381
dnl ================================================================
 
382
 
 
383
AM_PATH_GLIB_2_0([glib_req_version],
 
384
                 [],
 
385
                 [AC_MSG_ERROR([glib-2.0 is required])],
 
386
                 [gobject gthread gmodule-no-export])
 
387
 
 
388
COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES gobject-2.0 gmodule-no-export-2.0"
 
389
 
 
390
dnl     ============================================================
 
391
dnl     Should cogl-pango be built?
 
392
dnl     ============================================================
 
393
 
 
394
AC_ARG_ENABLE(
 
395
  [cogl-pango],
 
396
  [AC_HELP_STRING([--enable-cogl-pango=@<:@no/yes@:>@], [Enable pango support @<:@default=yes@:>@])],
 
397
  [],
 
398
  enable_cogl_pango=yes
 
399
)
 
400
AS_IF([test "x$enable_cogl_pango" = "xyes"],
 
401
      [
 
402
        COGL_PANGO_PKG_REQUIRES="$COGL_PANGO_PKG_REQUIRES pangocairo >= pangocairo_req_version"
 
403
      ]
 
404
)
 
405
 
 
406
dnl     ============================================================
 
407
dnl     Should cogl-path be built?
 
408
dnl     ============================================================
 
409
 
 
410
AC_ARG_ENABLE(
 
411
  [cogl-path],
 
412
  [AC_HELP_STRING([--enable-cogl-path=@<:@no/yes@:>@], [Enable 2D path support @<:@default=yes@:>@])],
 
413
  [],
 
414
  enable_cogl_path=yes
 
415
)
 
416
AS_IF([test "x$enable_cogl_path" = "xyes"],
 
417
      [
 
418
        COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_COGL_PATH_SUPPORT"
 
419
      ]
 
420
)
 
421
 
 
422
dnl     ============================================================
 
423
dnl     Choose image loading backend
 
424
dnl     ============================================================
 
425
COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES gdk-pixbuf-2.0 >= gdk_pixbuf_req_version"
 
426
COGL_IMAGE_BACKEND="gdk-pixbuf"
 
427
 
 
428
dnl     ============================================================
 
429
dnl     Determine which drivers and window systems we can support
 
430
dnl     ============================================================
 
431
 
 
432
dnl         ========================================================
 
433
dnl         Drivers first...
 
434
dnl         ========================================================
 
435
EGL_CHECKED=no
 
436
 
 
437
enabled_drivers=""
 
438
 
 
439
HAVE_GLES1=0
 
440
AC_ARG_ENABLE(
 
441
  [gles1],
 
442
  [AC_HELP_STRING([--enable-gles1=@<:@no/yes@:>@], [Enable support for OpenGL-ES 1.1 @<:@default=no@:>@])],
 
443
  [],
 
444
  enable_gles1=no
 
445
)
 
446
AS_IF([test "x$enable_gles1" = "xyes"],
 
447
      [
 
448
        enabled_drivers="$enabled_drivers gles1"
 
449
 
 
450
        cogl_gl_headers="GLES/gl.h GLES/glext.h"
 
451
 
 
452
        AC_DEFINE([HAVE_COGL_GLES], 1, [Have GLES 1.1 for rendering])
 
453
        COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_GLES CLUTTER_COGL_HAS_GLES"
 
454
        COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_GLES1"
 
455
        HAVE_GLES1=1
 
456
 
 
457
        PKG_CHECK_EXISTS([glesv1_cm],
 
458
          [COGL_PKG_REQUIRES_GL="$COGL_PKG_REQUIRES_GL glesv1_cm"
 
459
           COGL_GLES1_LIBNAME="libGLESv1_CM.so"
 
460
          ],
 
461
          [
 
462
            # We have to check the two headers independently as GLES/glext.h
 
463
            # needs to include GLES/gl.h to have the GL types defined (eg.
 
464
            # GLenum).
 
465
            AC_CHECK_HEADER([GLES/gl.h],
 
466
                            [],
 
467
                            [AC_MSG_ERROR([Unable to locate GLES/gl.h])])
 
468
            AC_CHECK_HEADER([GLES/glext.h],
 
469
                            [],
 
470
                            [AC_MSG_ERROR([Unable to locate GLES/glext.h])],
 
471
                            [#include <GLES/gl.h>])
 
472
 
 
473
            # Early implementations provided only a GLES/egl.h while Khronos's
 
474
            # implementer guide now states EGL/egl.h is the One. Some
 
475
            # implementations keep a GLES/egl.h wrapper around EGL/egl.h for
 
476
            # backward compatibility while others provide EGL/egl.h only.
 
477
            AC_CHECK_HEADERS([GLES/egl.h EGL/egl.h])
 
478
 
 
479
            AS_IF([test "x$ac_cv_header_GLES_egl_h" = "xyes"],
 
480
                  [COGL_EGL_INCLUDES="#include <GLES/egl.h>"],
 
481
                  [test "x$ac_cv_header_EGL_egl_h" = "xyes"],
 
482
                  [
 
483
                    COGL_EGL_INCLUDES="#include <EGL/egl.h>"
 
484
                  ],
 
485
                  [AC_MSG_ERROR([Unable to locate EGL header])])
 
486
            AC_SUBST([COGL_EGL_INCLUDES])
 
487
 
 
488
            AC_CHECK_HEADERS([EGL/eglext.h],
 
489
                             [COGL_EGL_INCLUDES="$COGL_EGL_INCLUDE
 
490
#include <EGL/eglext.h>"],
 
491
                             [],
 
492
                             [$COGL_EGL_INCLUDES])
 
493
 
 
494
            # Check for a GLES 1.x Common Profile library with/without EGL.
 
495
            #
 
496
            # Note: historically GLES 1 libraries shipped with the
 
497
            # EGL and GLES symbols all bundled in one library. Now
 
498
            # the Khronos Implementers Guide defines two naming
 
499
            # schemes: -lGLES_CM should be used for a library that
 
500
            # bundles the GLES and EGL API together and -lGLESv1_CM
 
501
            # would be used for a standalone GLES API.
 
502
            AC_CHECK_LIB(GLES_CM, [eglInitialize],
 
503
              [COGL_GLES1_LIBNAME="libGLES_CM.so"],
 
504
              [
 
505
                AC_CHECK_LIB(GLESv1_CM, [glFlush],
 
506
                  [COGL_GLES1_LIBNAME="libGLESv1_CM.so"
 
507
                   NEED_SEPARATE_EGL=yes
 
508
                  ],
 
509
                  [AC_MSG_ERROR([Unable to locate required GLES 1.x Common Profile library])])
 
510
              ])
 
511
 
 
512
            EGL_CHECKED=yes
 
513
          ])
 
514
      ])
 
515
 
 
516
HAVE_GLES2=0
 
517
AC_ARG_ENABLE(
 
518
  [gles2],
 
519
  [AC_HELP_STRING([--enable-gles2=@<:@no/yes@:>@], [Enable support for OpenGL-ES 2.0 @<:@default=no@:>@])],
 
520
  [],
 
521
  enable_gles2=no
 
522
)
 
523
AS_IF([test "x$enable_gles2" = "xyes"],
 
524
      [
 
525
        enabled_drivers="$enabled_drivers gles2"
 
526
 
 
527
        cogl_gl_headers="GLES2/gl2.h GLES2/gl2ext.h"
 
528
        AC_DEFINE([HAVE_COGL_GLES2], 1, [Have GLES 2.0 for rendering])
 
529
        COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_GLES CLUTTER_COGL_HAS_GLES"
 
530
        COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_GLES2"
 
531
        HAVE_GLES2=1
 
532
 
 
533
        PKG_CHECK_EXISTS([glesv2],
 
534
          [COGL_PKG_REQUIRES_GL="$COGL_PKG_REQUIRES_GL glesv2"
 
535
           COGL_GLES2_LIBNAME="libGLESv2.so"
 
536
          ],
 
537
          [
 
538
            # We have to check the two headers independently as GLES2/gl2ext.h
 
539
            # needs to include GLES2/gl2.h to have the GL types defined (eg.
 
540
            # GLenum).
 
541
            AC_CHECK_HEADER([GLES2/gl2.h],
 
542
                            [],
 
543
                            [AC_MSG_ERROR([Unable to locate GLES2/gl2.h])])
 
544
            AC_CHECK_HEADER([GLES2/gl2ext.h],
 
545
                            [],
 
546
                            [AC_MSG_ERROR([Unable to locate GLES2/gl2ext.h])],
 
547
                            [#include <GLES2/gl2.h>])
 
548
 
 
549
            COGL_GLES2_LIBNAME="libGLESv2.so"
 
550
          ])
 
551
      ])
 
552
 
 
553
HAVE_GL=0
 
554
AC_ARG_ENABLE(
 
555
  [gl],
 
556
  [AC_HELP_STRING([--enable-gl=@<:@no/yes@:>@], [Enable support for OpenGL @<:@default=yes@:>@])],
 
557
  [],
 
558
  [enable_gl=yes]
 
559
)
 
560
AS_IF([test "x$enable_gl" = "xyes"],
 
561
      [
 
562
        enabled_drivers="$enabled_drivers gl"
 
563
 
 
564
        PKG_CHECK_EXISTS([x11], [ALLOW_GLX=yes])
 
565
 
 
566
        cogl_gl_headers="GL/gl.h"
 
567
 
 
568
        PKG_CHECK_EXISTS([gl],
 
569
        dnl We don't want to use COGL_PKG_REQUIRES here because we don't want to
 
570
        dnl directly link against libGL
 
571
        [COGL_PKG_REQUIRES_GL="$COGL_PKG_REQUIRES_GL gl"],
 
572
        [AC_CHECK_LIB(GL, [glGetString],
 
573
        ,
 
574
        [AC_MSG_ERROR([Unable to locate required GL library])])
 
575
        ])
 
576
        COGL_GL_LIBNAME="libGL.so.1"
 
577
 
 
578
        AC_DEFINE([HAVE_COGL_GL], [1], [Have GL for rendering])
 
579
 
 
580
        COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_GL"
 
581
        COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS CLUTTER_COGL_HAS_GL"
 
582
        HAVE_GL=1
 
583
      ])
 
584
 
 
585
AM_CONDITIONAL([COGL_DRIVER_GL_SUPPORTED], [test "x$enable_gl" = "xyes"])
 
586
AM_CONDITIONAL([COGL_DRIVER_GLES_SUPPORTED],
 
587
               [test "x$enable_gles1" = "xyes" || test "x$enable_gles2" = "xyes"])
 
588
 
 
589
dnl Allow the GL library names and default driver to be overridden with configure options
 
590
AC_ARG_WITH([gl-libname],
 
591
            [AS_HELP_STRING([--with-gl-libname],
 
592
                            override the name of the GL library to dlopen)],
 
593
            [COGL_GL_LIBNAME="$withval"])
 
594
AC_ARG_WITH([gles1-libname],
 
595
            [AS_HELP_STRING([--with-gles1-libname],
 
596
                            override the name of the GLESv1 library to dlopen)],
 
597
            [COGL_GLES1_LIBNAME="$withval"])
 
598
AC_ARG_WITH([gles2-libname],
 
599
            [AS_HELP_STRING([--with-gles2-libname],
 
600
                            override the name of the GLESv2 library to dlopen)],
 
601
            [COGL_GLES2_LIBNAME="$withval"])
 
602
AC_ARG_WITH([default-driver],
 
603
            [AS_HELP_STRING([--with-default-driver],
 
604
                            specify a default cogl driver)],
 
605
            [COGL_DEFAULT_DRIVER="${withval}"],
 
606
            [COGL_DEFAULT_DRIVER="" ])
 
607
 
 
608
AM_CONDITIONAL(HAVE_COGL_DEFAULT_DRIVER,
 
609
  [ test "x$COGL_DEFAULT_DRIVER" != "x" ])
 
610
 
 
611
 
 
612
AC_SUBST([COGL_GL_LIBNAME])
 
613
AC_SUBST([HAVE_GL])
 
614
AC_SUBST([COGL_GLES1_LIBNAME])
 
615
AC_SUBST([HAVE_GLES1])
 
616
AC_SUBST([COGL_GLES2_LIBNAME])
 
617
AC_SUBST([HAVE_GLES2])
 
618
AC_SUBST([COGL_DEFAULT_DRIVER])
 
619
 
 
620
AC_ARG_ENABLE(
 
621
  [cogl-gles2],
 
622
  [AC_HELP_STRING([--enable-cogl-gles2=@<:@no/yes@:>@],
 
623
                  [Enable libcogl-gles2 frontend api for OpenGL-ES 2.0 @<:@default=auto@:>@])],
 
624
  [],
 
625
  [
 
626
    AS_IF([test "x$HAVE_GLES2" = "x1"],
 
627
          [enable_cogl_gles2=yes],
 
628
          [enable_cogl_gles2=no])
 
629
  ]
 
630
)
 
631
AS_IF([test "x$enable_cogl_gles2" = "xyes"],
 
632
      [
 
633
        AS_IF([test "x$HAVE_GLES2" != "x1"],
 
634
              [
 
635
                AC_MSG_ERROR([libcogl-gles2 is currently only supported on systems with a native GLES 2.0 library])
 
636
              ])
 
637
      ])
 
638
AM_CONDITIONAL([BUILD_COGL_GLES2], [test "x$enable_cogl_gles2" = "xyes"])
 
639
 
 
640
 
 
641
dnl         ========================================================
 
642
dnl         Check window system integration libraries...
 
643
dnl         ========================================================
 
644
 
 
645
AC_ARG_ENABLE(
 
646
  [glx],
 
647
  [AC_HELP_STRING([--enable-glx=@<:@no/yes@:>@], [Enable support GLX @<:@default=auto@:>@])],
 
648
  [],
 
649
  [AS_IF([test "x$ALLOW_GLX" = "xyes"], [enable_glx=yes], [enable_glx=no])]
 
650
)
 
651
AS_IF([test "x$enable_glx" = "xyes"],
 
652
      [
 
653
        AS_IF([test "x$ALLOW_GLX" != "xyes"],
 
654
              [AC_MSG_ERROR([GLX not supported with this configuration])])
 
655
 
 
656
        NEED_XLIB=yes
 
657
        SUPPORT_GLX=yes
 
658
        GL_WINSYS_APIS="$GL_WINSYS_APIS glx"
 
659
 
 
660
        COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_GLX_SUPPORT"
 
661
      ])
 
662
AM_CONDITIONAL(SUPPORT_GLX, [test "x$SUPPORT_GLX" = "xyes"])
 
663
 
 
664
EGL_PLATFORM_COUNT=0
 
665
 
 
666
AC_ARG_ENABLE(
 
667
  [kms-egl-platform],
 
668
  [AC_HELP_STRING([--enable-kms-egl-platform=@<:@no/yes@:>@], [Enable support for the KMS egl platform @<:@default=no@:>@])],
 
669
  [],
 
670
  enable_kms_egl_platform=yes
 
671
)
 
672
AS_IF([test "x$enable_kms_egl_platform" = "xyes"],
 
673
      [
 
674
        EGL_PLATFORM_COUNT=$((EGL_PLATFORM_COUNT+1))
 
675
        NEED_EGL=yes
 
676
        EGL_PLATFORMS="$EGL_PLATFORMS kms"
 
677
 
 
678
        PKG_CHECK_EXISTS([gbm],
 
679
                         [
 
680
                           COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES gbm"
 
681
                           COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES libdrm"
 
682
                         ],
 
683
                         [AC_MSG_ERROR([Unable to locate required libgbm library for the KMS egl platform])])
 
684
 
 
685
        GBM_VERSION=`$PKG_CONFIG --modversion gbm`
 
686
        GBM_MAJOR=`echo $GBM_VERSION | cut -d'.' -f1`
 
687
        GBM_MINOR=`echo $GBM_VERSION | cut -d'.' -f2`
 
688
        GBM_MICRO=`echo $GBM_VERSION | cut -d'.' -f3 | sed 's/-.*//'`
 
689
 
 
690
        AC_DEFINE_UNQUOTED([COGL_GBM_MAJOR], [$GBM_MAJOR], [The major version for libgbm])
 
691
        AC_DEFINE_UNQUOTED([COGL_GBM_MINOR], [$GBM_MINOR], [The minor version for libgbm])
 
692
        AC_DEFINE_UNQUOTED([COGL_GBM_MICRO], [$GBM_MICRO], [The micro version for libgbm])
 
693
 
 
694
        COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_EGL_PLATFORM_KMS_SUPPORT"
 
695
      ])
 
696
AM_CONDITIONAL(SUPPORT_EGL_PLATFORM_KMS,
 
697
               [test "x$enable_kms_egl_platform" = "xyes"])
 
698
 
 
699
AC_ARG_ENABLE(
 
700
  [wayland-egl-server],
 
701
  [AC_HELP_STRING([--enable-wayland-egl-server=@<:@no/yes@:>@], [Enable server side wayland support @<:@default=no@:>@])],
 
702
  [],
 
703
  enable_wayland_egl_server=yes
 
704
)
 
705
AS_IF([test "x$enable_wayland_egl_server" = "xyes"],
 
706
      [
 
707
        NEED_EGL=yes
 
708
 
 
709
        PKG_CHECK_MODULES(WAYLAND_SERVER,
 
710
                          [wayland-server >= wayland_server_req_version])
 
711
        COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES wayland-server >= wayland_server_req_version"
 
712
 
 
713
        COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_WAYLAND_EGL_SERVER_SUPPORT"
 
714
      ])
 
715
AM_CONDITIONAL(SUPPORT_WAYLAND_EGL_SERVER,
 
716
               [test "x$enable_wayland_egl_server" = "xyes"])
 
717
 
 
718
dnl This should go last, since it's the default fallback and we need
 
719
dnl to check the value of $EGL_PLATFORM_COUNT here.
 
720
AC_ARG_ENABLE(
 
721
  [xlib-egl-platform],
 
722
  [AC_HELP_STRING([--enable-xlib-egl-platform=@<:@no/yes@:>@], [Enable support for the Xlib egl platform @<:@default=auto@:>@])],
 
723
  [],
 
724
  enable_xlib_egl_platform=yes
 
725
)
 
726
AS_IF([test "x$enable_xlib_egl_platform" = "xyes"],
 
727
      [
 
728
        EGL_PLATFORM_COUNT=$((EGL_PLATFORM_COUNT+1))
 
729
        NEED_EGL=yes
 
730
        NEED_XLIB=yes
 
731
        EGL_PLATFORMS="$EGL_PLATFORMS xlib"
 
732
 
 
733
        COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_EGL_PLATFORM_XLIB_SUPPORT"
 
734
      ])
 
735
AM_CONDITIONAL(SUPPORT_EGL_PLATFORM_XLIB,
 
736
               [test "x$enable_xlib_egl_platform" = "xyes"])
 
737
 
 
738
AS_IF([test "x$NEED_EGL" = "xyes" && test "x$EGL_CHECKED" != "xyes"],
 
739
      [
 
740
        PKG_CHECK_EXISTS([egl],
 
741
          [COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES egl"],
 
742
          [
 
743
            AC_CHECK_HEADERS(
 
744
              [EGL/egl.h],
 
745
              [],
 
746
              [AC_MSG_ERROR([Unable to locate required EGL headers])])
 
747
            AC_CHECK_HEADERS(
 
748
              [EGL/eglext.h],
 
749
              [],
 
750
              [AC_MSG_ERROR([Unable to locate required EGL headers])],
 
751
              [#include <EGL/egl.h>])
 
752
 
 
753
            AC_CHECK_LIB(EGL, [eglInitialize],
 
754
              [COGL_EXTRA_LDFLAGS="$COGL_EXTRA_LDFLAGS -lEGL"],
 
755
              [AC_MSG_ERROR([Unable to locate required EGL library])])
 
756
 
 
757
            COGL_EXTRA_LDFLAGS="$COGL_EXTRA_LDFLAGS -lEGL"
 
758
          ]
 
759
          )
 
760
 
 
761
        COGL_EGL_INCLUDES="#include <EGL/egl.h>
 
762
#include <EGL/eglext.h>"
 
763
        AC_SUBST([COGL_EGL_INCLUDES])
 
764
      ])
 
765
 
 
766
AS_IF([test "x$NEED_EGL" = "xyes"],
 
767
      [
 
768
        SUPPORT_EGL=yes
 
769
        GL_WINSYS_APIS="$GL_WINSYS_APIS egl"
 
770
        COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_EGL_SUPPORT"
 
771
      ])
 
772
 
 
773
AM_CONDITIONAL(SUPPORT_EGL, [test "x$SUPPORT_EGL" = "xyes"])
 
774
 
 
775
dnl         ========================================================
 
776
dnl         Check X11 dependencies if required
 
777
dnl         ========================================================
 
778
AS_IF([test "x$NEED_XLIB" = "xyes"],
 
779
      [
 
780
        X11_MODULES="x11 xext xfixes >= xfixes_req_version xdamage xcomposite >= xcomposite_req_version xrandr >= xrandr_req_version"
 
781
        PKG_CHECK_MODULES(DUMMY, [$X11_MODULES],
 
782
                          [COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES $X11_MODULES"])
 
783
        SUPPORT_X11=yes
 
784
        SUPPORT_XLIB=yes
 
785
 
 
786
        COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_X11"
 
787
        COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_X11_SUPPORT"
 
788
        COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_XLIB"
 
789
        COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_XLIB_SUPPORT"
 
790
      ])
 
791
 
 
792
AM_CONDITIONAL(X11_TESTS, [test "x$SUPPORT_X11" = "xyes"])
 
793
AM_CONDITIONAL(SUPPORT_X11, [test "x$SUPPORT_X11" = "xyes"])
 
794
AM_CONDITIONAL(SUPPORT_XLIB, [test "x$SUPPORT_XLIB" = "xyes"])
 
795
 
 
796
dnl ================================================================
 
797
dnl Documentation stuff.
 
798
dnl ================================================================
 
799
GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
 
800
GDKPIXBUF_PREFIX="`$PKG_CONFIG --variable=prefix gdk-pixbuf-2.0`"
 
801
AC_SUBST(GLIB_PREFIX)
 
802
AC_SUBST(GDKPIXBUF_PREFIX)
 
803
 
 
804
 
 
805
AC_SUBST(COGL_PKG_REQUIRES)
 
806
if test -n "$COGL_PKG_REQUIRES"; then
 
807
  PKG_CHECK_MODULES(COGL_DEP, [$COGL_PKG_REQUIRES])
 
808
 
 
809
  if test -n "$COGL_PKG_REQUIRES_GL"; then
 
810
    PKG_CHECK_MODULES(COGL_DEP_GL, [$COGL_PKG_REQUIRES_GL])
 
811
 
 
812
    dnl Strip out the GL libraries from the GL pkg-config files so we can
 
813
    dnl dynamically load them instead
 
814
    gl_libs=""
 
815
    for x in $COGL_DEP_GL_LIBS; do
 
816
      AS_CASE([$x],
 
817
              [-lGL], [],
 
818
              [-lGLESv2], [],
 
819
              [-lGLESv1_CM], [],
 
820
              [*], [gl_libs="$gl_libs $x"])
 
821
    done
 
822
    COGL_DEP_CFLAGS="$COGL_DEP_CFLAGS $COGL_DEP_CFLAGS_GL"
 
823
    COGL_DEP_LIBS="$COGL_DEP_LIBS $gl_libs"
 
824
  fi
 
825
fi
 
826
AC_SUBST(COGL_PANGO_PKG_REQUIRES)
 
827
 
 
828
AS_IF([test "x$enable_cogl_pango" = "xyes"],
 
829
  [PKG_CHECK_MODULES(COGL_PANGO_DEP, [$COGL_PANGO_PKG_REQUIRES])]
 
830
)
 
831
AM_CONDITIONAL([BUILD_COGL_PANGO], [test "x$enable_cogl_pango" = "xyes"])
 
832
 
 
833
AM_CONDITIONAL([BUILD_COGL_PATH], [test "x$enable_cogl_path" = "xyes"])
 
834
 
 
835
dnl ================================================================
 
836
dnl Misc program dependencies.
 
837
dnl ================================================================
 
838
AC_PROG_INSTALL
 
839
 
 
840
dnl ================================================================
 
841
dnl GObject-Introspection check
 
842
dnl ================================================================
 
843
GOBJECT_INTROSPECTION_CHECK([gi_req_version])
 
844
 
 
845
dnl ================================================================
 
846
dnl Checks for header files.
 
847
dnl ================================================================
 
848
AC_PATH_X
 
849
AC_HEADER_STDC
 
850
AC_CHECK_HEADERS(fcntl.h limits.h unistd.h)
 
851
AC_CHECK_HEADER([endian.h],
 
852
                [AC_CHECK_DECL([__FLOAT_WORD_ORDER],
 
853
                               AC_DEFINE([HAVE_FLOAT_WORD_ORDER], [1],
 
854
                                         [Has the __FLOAT_WORD_ORDER macro]))])
 
855
 
 
856
dnl ================================================================
 
857
dnl Checks for library functions.
 
858
dnl ================================================================
 
859
 
 
860
dnl The 'ffs' function is part of C99 so it isn't always
 
861
dnl available. Cogl has a fallback if needed.
 
862
AC_CHECK_FUNCS([ffs])
 
863
 
 
864
dnl 'memmem' is a GNU extension but we have a simple fallback
 
865
AC_CHECK_FUNCS([memmem])
 
866
 
 
867
dnl This is used in the cogl-gles2-gears example but it is a GNU extension
 
868
save_libs="$LIBS"
 
869
LIBS="$LIBS $LIBM"
 
870
AC_CHECK_FUNCS([sincos])
 
871
LIBS="$save_libs"
 
872
 
 
873
dnl ================================================================
 
874
dnl Platform values
 
875
dnl ================================================================
 
876
 
 
877
dnl These are values from system headers that we want to copy into the
 
878
dnl public Cogl headers without having to include the system header
 
879
have_poll_h=no
 
880
AC_CHECK_HEADER(poll.h,
 
881
               [
 
882
                AC_COMPUTE_INT(COGL_SYSDEF_POLLIN, POLLIN, [#include <poll.h>],
 
883
                               AC_MSG_ERROR([Unable to get value of POLLIN]))
 
884
                AC_COMPUTE_INT(COGL_SYSDEF_POLLPRI, POLLPRI, [#include <poll.h>],
 
885
                               AC_MSG_ERROR([Unable to get value of POLLPRI]))
 
886
                AC_COMPUTE_INT(COGL_SYSDEF_POLLOUT, POLLOUT, [#include <poll.h>],
 
887
                               AC_MSG_ERROR([Unable to get value of POLLOUT]))
 
888
                AC_COMPUTE_INT(COGL_SYSDEF_POLLERR, POLLERR, [#include <poll.h>],
 
889
                               AC_MSG_ERROR([Unable to get value of POLLERR]))
 
890
                AC_COMPUTE_INT(COGL_SYSDEF_POLLHUP, POLLHUP, [#include <poll.h>],
 
891
                               AC_MSG_ERROR([Unable to get value of POLLHUP]))
 
892
                AC_COMPUTE_INT(COGL_SYSDEF_POLLNVAL, POLLNVAL, [#include <poll.h>],
 
893
                               AC_MSG_ERROR([Unable to get value of POLLNVAL]))
 
894
                COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_POLL_SUPPORT"
 
895
                have_poll_h=yes
 
896
               ])
 
897
 
 
898
AS_IF([test "x$have_poll_h" = "xno"],
 
899
      [
 
900
       COGL_SYSDEF_POLLIN=1
 
901
       COGL_SYSDEF_POLLPRI=2
 
902
       COGL_SYSDEF_POLLOUT=4
 
903
       COGL_SYSDEF_POLLERR=8
 
904
       COGL_SYSDEF_POLLHUP=16
 
905
       COGL_SYSDEF_POLLNVAL=32
 
906
      ])
 
907
 
 
908
COGL_DEFINES_EXTRA="$COGL_DEFINES_EXTRA
 
909
#define COGL_SYSDEF_POLLIN $COGL_SYSDEF_POLLIN
 
910
#define COGL_SYSDEF_POLLPRI $COGL_SYSDEF_POLLPRI
 
911
#define COGL_SYSDEF_POLLOUT $COGL_SYSDEF_POLLOUT
 
912
#define COGL_SYSDEF_POLLERR $COGL_SYSDEF_POLLERR
 
913
#define COGL_SYSDEF_POLLHUP $COGL_SYSDEF_POLLHUP
 
914
#define COGL_SYSDEF_POLLNVAL $COGL_SYSDEF_POLLNVAL
 
915
"
 
916
 
 
917
dnl ================================================================
 
918
dnl What needs to be substituted in other files
 
919
dnl ================================================================
 
920
COGL_DEFINES="$COGL_DEFINES_EXTRA"
 
921
for x in $COGL_DEFINES_SYMBOLS; do
 
922
  COGL_DEFINES="$COGL_DEFINES
 
923
#define $x 1"
 
924
done;
 
925
AC_SUBST(COGL_DEFINES)
 
926
AM_SUBST_NOTMAKE(COGL_DEFINES)
 
927
 
 
928
AS_IF([test "x$cogl_gl_headers" = "x"],
 
929
      [AC_MSG_ERROR([Internal error: no GL header set])])
 
930
dnl cogl_gl_headers is a space separate list of headers to
 
931
dnl include. We'll now convert them to a single variable with a
 
932
dnl #include line for each header
 
933
COGL_GL_HEADER_INCLUDES=""
 
934
for x in $cogl_gl_headers; do
 
935
  COGL_GL_HEADER_INCLUDES="$COGL_GL_HEADER_INCLUDES
 
936
#include <$x>"
 
937
done;
 
938
AC_SUBST(COGL_GL_HEADER_INCLUDES)
 
939
AM_SUBST_NOTMAKE(COGL_GL_HEADER_INCLUDES)
 
940
 
 
941
AC_SUBST(COGL_DEP_CFLAGS)
 
942
AC_SUBST(COGL_DEP_LIBS)
 
943
AC_SUBST(COGL_PANGO_DEP_CFLAGS)
 
944
AC_SUBST(COGL_PANGO_DEP_LIBS)
 
945
AC_SUBST(COGL_GST_DEP_CFLAGS)
 
946
AC_SUBST(COGL_GST_DEP_LIBS)
 
947
AC_SUBST(COGL_EXTRA_CFLAGS)
 
948
AC_SUBST(COGL_EXTRA_LDFLAGS)
 
949
 
 
950
# just for compatability with the clutter build...
 
951
MAINTAINER_CFLAGS=
 
952
AC_SUBST(MAINTAINER_CFLAGS)
 
953
 
 
954
AC_OUTPUT(
 
955
Makefile
 
956
test-fixtures/Makefile
 
957
cogl/Makefile
 
958
cogl/mutter-cogl-$LIBMUTTER_API_VERSION.pc:cogl/mutter-cogl.pc.in
 
959
cogl/cogl-defines.h
 
960
cogl/cogl-gl-header.h
 
961
cogl/cogl-egl-defines.h
 
962
cogl-pango/Makefile
 
963
cogl-pango/mutter-cogl-pango-$LIBMUTTER_API_VERSION.pc:cogl-pango/mutter-cogl-pango.pc.in
 
964
cogl-path/Makefile
 
965
cogl-path/mutter-cogl-path-$LIBMUTTER_API_VERSION.pc:cogl-path/mutter-cogl-path.pc.in
 
966
cogl-gles2/Makefile
 
967
cogl-gles2/mutter-cogl-gles2-$LIBMUTTER_API_VERSION.pc:cogl-gles2/mutter-cogl-gles2.pc.in
 
968
tests/Makefile
 
969
tests/config.env
 
970
tests/conform/Makefile
 
971
tests/unit/Makefile
 
972
tests/micro-perf/Makefile
 
973
tests/data/Makefile
 
974
)
 
975
 
 
976
dnl ================================================================
 
977
dnl Dah Da!
 
978
dnl ================================================================
 
979
echo ""
 
980
echo "Cogl - $COGL_1_VERSION/$COGL_VERSION (${COGL_RELEASE_STATUS})"
 
981
 
 
982
# Global flags
 
983
echo ""
 
984
echo " • Global:"
 
985
echo "        Prefix: ${prefix}"
 
986
if test "x$COGL_DEFAULT_DRIVER" != "x"; then
 
987
echo "        Default driver: ${COGL_DEFAULT_DRIVER}"
 
988
fi
 
989
 
 
990
echo ""
 
991
# Features
 
992
echo " • Features:"
 
993
echo "        Drivers: ${enabled_drivers}"
 
994
for driver in $enabled_drivers; do
 
995
        driver=`echo $driver | tr "[gles]" "[GLES]"`
 
996
        libname=`eval echo \\$COGL_${driver}_LIBNAME`
 
997
        echo "        Library name for $driver: $libname"
 
998
done
 
999
echo "        GL Window System APIs:${GL_WINSYS_APIS}"
 
1000
if test "x$SUPPORT_EGL" = "xyes"; then
 
1001
echo "        EGL Platforms:${EGL_PLATFORMS}"
 
1002
echo "        Wayland compositor support: ${enable_wayland_egl_server}"
 
1003
fi
 
1004
echo "        Build libcogl-gles2 GLES 2.0 frontend api: ${enable_cogl_gles2}"
 
1005
echo "        Image backend: ${COGL_IMAGE_BACKEND}"
 
1006
echo "        Cogl Pango: ${enable_cogl_pango}"
 
1007
echo "        Cogl Path: ${enable_cogl_path}"
 
1008
 
 
1009
# Compiler/Debug related flags
 
1010
echo ""
 
1011
echo " • Build options:"
 
1012
echo "        Debugging: ${enable_debug}"
 
1013
echo "        Profiling: ${enable_profile}"
 
1014
echo "        Enable deprecated symbols: ${enable_deprecated}"
 
1015
echo "        Compiler flags: ${CFLAGS} ${COGL_EXTRA_CFLAGS}"
 
1016
echo "        Linker flags: ${LDFLAGS} ${COGL_EXTRA_LDFLAGS}"
 
1017
 
 
1018
# Miscellaneous
 
1019
echo ""
 
1020
echo " • Extra:"
 
1021
echo "        Build introspection data: ${enable_introspection}"
 
1022
echo "        Build unit tests: ${enable_unit_tests}"
 
1023
 
 
1024
echo ""