cleanup specfile for packaging
[profile/ivi/cogl.git] / configure.ac
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], [10])
28 m4_define([cogl_1_micro_version], [2])
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], 10)
59 m4_define([cogl_lt_revision], 1)
60 m4_define([cogl_lt_age], 1)
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 m4_define([cogl_release_status], [release])
74
75 AC_INIT(cogl, [cogl_1_version])
76 AC_CONFIG_SRCDIR(cogl/cogl.h)
77 AC_CONFIG_AUX_DIR([build])
78 AC_CONFIG_MACRO_DIR([build/autotools])
79 AC_CONFIG_HEADERS(config.h)
80
81 dnl ================================================================
82 dnl Required versions for dependencies
83 dnl ================================================================
84 m4_define([glib_req_version],           [2.28.0])
85 m4_define([pangocairo_req_version],     [1.20])
86 m4_define([gi_req_version],             [0.9.5])
87 m4_define([gdk_pixbuf_req_version],     [2.0])
88 m4_define([uprof_req_version],          [0.3])
89 m4_define([gtk_doc_req_version],        [1.13])
90 m4_define([xfixes_req_version],         [3])
91 m4_define([xcomposite_req_version],     [0.4])
92 m4_define([cairo_req_version],          [1.10])
93
94 dnl These variables get copied into the generated README
95 AC_SUBST([GLIB_REQ_VERSION], [glib_req_version])
96 AC_SUBST([GDK_PIXBUF_REQ_VERSION], [gdk_pixbuf_req_version])
97 AC_SUBST([CAIRO_REQ_VERSION], [cairo_req_version])
98 AC_SUBST([PANGOCAIRO_REQ_VERSION], [pangocairo_req_version])
99 AC_SUBST([XCOMPOSITE_REQ_VERSION], [xcomposite_req_version])
100 AC_SUBST([XFIXES_REQ_VERSION], [xfixes_req_version])
101 AC_SUBST([GTK_DOC_REQ_VERSION], [gtk_doc_req_version])
102 AC_SUBST([GI_REQ_VERSION], [gi_req_version])
103 AC_SUBST([UPROF_REQ_VERSION], [uprof_req_version])
104
105 # Save this value here, since automake will set cflags later and we
106 # want to know if the user specified custom cflags or not.
107 cflags_set=${CFLAGS+set}
108
109 AM_INIT_AUTOMAKE([1.11 foreign -Wno-portability no-define no-dist-gzip
110                   dist-bzip2 tar-ustar])
111 AM_SILENT_RULES([yes])
112
113 AH_BOTTOM([#include "config-custom.h"])
114
115 dnl ================================================================
116 dnl Export the API versioning
117 dnl ================================================================
118 AC_SUBST([COGL_MAJOR_VERSION],[cogl_major_version])
119 AC_SUBST([COGL_MINOR_VERSION],[cogl_minor_version])
120 AC_SUBST([COGL_MICRO_VERSION],[cogl_micro_version])
121 AC_SUBST([COGL_VERSION],[cogl_version])
122 AC_SUBST([COGL_API_VERSION],[cogl_major_version.0])
123 AC_SUBST([COGL_API_VERSION_AM],[$COGL_MAJOR_VERSION\_0])
124
125 AC_SUBST([COGL_1_MINOR_VERSION],[cogl_1_minor_version])
126 AC_SUBST([COGL_1_MICRO_VERSION],[cogl_1_micro_version])
127 AC_SUBST([COGL_1_VERSION],[cogl_1_version])
128
129
130 dnl ================================================================
131 dnl Export the libtool versioning
132 dnl ================================================================
133 AC_SUBST([COGL_LT_CURRENT], [cogl_lt_current])
134 AC_SUBST([COGL_LT_REVISION], [cogl_lt_revision])
135 AC_SUBST([COGL_LT_AGE], [cogl_lt_age])
136 AC_SUBST([COGL_LT_RELEASE], [cogl_lt_release])
137
138
139 dnl ================================================================
140 dnl Export the source code release status
141 dnl ================================================================
142 AC_SUBST([COGL_RELEASE_STATUS], [cogl_release_status])
143
144
145 dnl ================================================================
146 dnl See what platform we are building for
147 dnl ================================================================
148 AC_CANONICAL_HOST
149 AC_MSG_CHECKING([if building for some Win32 platform])
150 AS_CASE([$host],
151         [*-*-mingw*|*-*-cygwin*],
152         [
153           COGL_EXTRA_LDFLAGS="$COGL_EXTRA_LDFLAGS -no-undefined"
154           platform_win32=yes
155         ],
156
157         [platform_win32=no]
158 )
159 AC_MSG_RESULT([$platform_win32])
160 AM_CONDITIONAL(OS_WIN32, [test "$platform_win32" = "yes"])
161
162 AC_CHECK_HEADER([OpenGL/gl.h], [platform_quartz=yes], [platform_quartz=no])
163 AM_CONDITIONAL(OS_QUARTZ, [test "$platform_quartz" = "yes"])
164
165 dnl ================================================================
166 dnl Handle extra configure options
167 dnl ================================================================
168
169 dnl     ============================================================
170 dnl     Enable debugging
171 dnl     ============================================================
172 m4_define([debug_default], [m4_if(cogl_release_status, [git], [yes], [no])])
173 AC_ARG_ENABLE(
174   [debug],
175   [AC_HELP_STRING([--enable-debug=@<:@no/yes@:>@], [Control Cogl debugging level @<:@default=]debug_default[@:>@])],
176   [],
177   enable_debug=debug_default
178 )
179 AS_CASE(
180   [$enable_debug],
181   [yes],
182   [
183     test "$cflags_set" = set || CFLAGS="$CFLAGS -g -O0"
184     COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS -DCOGL_GL_DEBUG -DCOGL_OBJECT_DEBUG -DCOGL_HANDLE_DEBUG -DCOGL_ENABLE_DEBUG"
185   ],
186   [no],
187   [
188     COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS -DCOGL_ENABLE_DEBUG -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
189   ],
190   [AC_MSG_ERROR([Unknown argument for --enable-debug])]
191 )
192
193 AC_SUBST(COGL_DEBUG_CFLAGS)
194
195
196 dnl     ============================================================
197 dnl     Enable cairo usage for debugging
198 dnl       (debugging code can use cairo to dump the atlas)
199 dnl     ============================================================
200
201 PKG_CHECK_EXISTS([CAIRO], [cairo >= cairo_req_version], [have_cairo=yes])
202 AC_ARG_ENABLE(
203   [cairo],
204   [AC_HELP_STRING([--enable-cairo=@<:@no/yes@:>@], [Control Cairo usage in Cogl debugging code @<:@default=auto@:>@])],
205   [],
206   [
207     AS_IF([test "x$enable_debug" = "xyes"],
208           [enable_cairo=$have_cairo],
209           [enable_cairo=no])
210   ]
211 )
212 AS_IF([test "x$enable_cairo" = "xyes" && test "x$enable_debug" = "xyes"],
213       [
214         AS_IF([test "x$have_cairo" != "xyes"],
215               [AC_MSG_ERROR([Could not find Cairo])])
216
217         COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES cairo >= cairo_req_version"
218         AC_DEFINE([HAVE_CAIRO], [1], [Whether we have cairo or not])
219       ])
220
221
222 dnl     ============================================================
223 dnl     Enable profiling
224 dnl     ============================================================
225 AC_ARG_ENABLE(profile,
226               [AC_HELP_STRING([--enable-profile=@<:@no/yes@:>@],
227                              [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@:>@])],
228               [],
229               [enable_profile=no])
230 AS_IF([test "x$enable_profile" = "xyes"],
231       [
232         AS_IF([test "x$GCC" = "xyes"],
233               [
234                 COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES uprof-0.3"
235                 COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS -DCOGL_ENABLE_PROFILE"
236                 AS_IF([test "x$enable_debug" = "xyes"], [COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS -DUPROF_DEBUG"])
237               ],
238               [
239                 AC_MSG_ERROR([--enable-profile is currently only supported if using GCC])
240               ])
241       ])
242 AM_CONDITIONAL(PROFILE, test "x$enable_profile" != "xno")
243
244
245 dnl     ============================================================
246 dnl     Enable strict compiler flags
247 dnl     ============================================================
248
249 # use strict compiler flags only when building from git; the rules for
250 # distcheck will take care of turning this on when making a release
251 m4_define([maintainer_default], [m4_if(cogl_release_status, [git], [yes], [no])])
252 AC_ARG_ENABLE(
253   [maintainer-flags],
254   [AC_HELP_STRING([--enable-maintainer-flags=@<:@no/yes/error@:>@], [Use strict compiler flags @<:@default=]maintainer_default[@:>@])],
255   [],
256   enable_maintainer_flags=maintainer_default
257 )
258
259 MAINTAINER_COMPILER_FLAGS="-Wall -Wcast-align -Wuninitialized
260                            -Wno-strict-aliasing -Wempty-body -Wformat
261                            -Wformat-security -Winit-self
262                            -Wdeclaration-after-statement -Wvla
263                            -Wpointer-arith -Wmissing-declarations"
264
265 AS_CASE(
266   [$enable_maintainer_flags],
267   [yes],
268   [
269     AS_COMPILER_FLAGS([MAINTAINER_CFLAGS], [$MAINTAINER_COMPILER_FLAGS])
270   ],
271   [no],
272   [
273   ],
274   [error],
275   [
276     MAINTAINER_COMPILER_FLAGS="$MAINTAINER_COMPILER_FLAGS -Werror"
277     AS_COMPILER_FLAGS([MAINTAINER_CFLAGS], [$MAINTAINER_COMPILER_FLAGS])
278   ],
279   [*],
280   [AC_MSG_ERROR([Invalid option for --enable-maintainer-flags])]
281 )
282
283 # strip leading spaces
284 COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS ${MAINTAINER_CFLAGS#*  }"
285
286
287 dnl     ============================================================
288 dnl     Enable deprecation guards
289 dnl     ============================================================
290
291 # disable deprecated options from Glib only when building from git;
292 # the rules for distcheck will take care of turning this on when
293 # making a release
294 m4_define([deprecated_default],
295           [m4_if(cogl_release_status, [git], [no], [yes])])
296
297 AC_ARG_ENABLE([deprecated],
298               [AS_HELP_STRING([--enable-deprecated=@<:@no/yes@:>@],
299                               [Whether deprecated symbols should be disabled when compiling Cogl @<:@default=]deprecated_default[@:>@])],
300               [],
301               [enable_deprecated=deprecated_default])
302
303 AS_CASE([$enable_deprecated],
304
305         [no],
306         [
307           DEPRECATED_CFLAGS="-DG_DISABLE_DEPRECATED -DG_DISABLE_SINGLE_INCLUDES"
308         ],
309
310         [yes],
311         [
312           DEPRECATED_CFLAGS=""
313         ],
314
315         [AC_MSG_ERROR([Unknown argument for --enable-deprecated])]
316 )
317
318 # strip leading spaces
319 COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS ${DEPRECATED_CFLAGS#*  }"
320
321 dnl     ============================================================
322 dnl     Choose image loading backend
323 dnl     ============================================================
324 AC_ARG_ENABLE(
325   [gdk-pixbuf],
326   [AC_HELP_STRING([--enable-gdk-pixbuf=@<:@no/yes@:>@], [Enable image loading via gdk-pixbuf @<:@default=yes@:>@])],
327   [],
328   enable_gdk_pixbuf=yes
329 )
330 if test "x$enable_gdk_pixbuf" = "xyes"; then
331   PKG_CHECK_EXISTS([gdk-pixbuf-2.0], [have_gdk_pixbuf=yes], [have_gdk_pixbuf=no])
332 else
333   have_gdk_pixbuf=no
334 fi
335
336 AC_ARG_ENABLE(
337   [quartz-image],
338   [AC_HELP_STRING([--enable-quartz-image=@<:@no/yes@:>@], [Enable image loading via quartz @<:@default=no@:>@])],
339   [],
340   enable_quartz_image=no
341 )
342
343 AS_IF(
344   [test "x$have_gdk_pixbuf" = "xyes"],
345   [
346     AC_DEFINE([USE_GDKPIXBUF], 1, [Use GdkPixbuf for loading image data])
347     COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES gdk-pixbuf-2.0 >= gdk_pixbuf_req_version"
348     COGL_IMAGE_BACKEND="gdk-pixbuf"
349   ],
350   [test "x$enable_quartz_image" = "xyes"],
351   [
352     EXPERIMENTAL_CONFIG=yes
353     EXPERIMENTAL_OPTIONS="$EXPERIMENTAL_OPTIONS Quartz Core Graphics,"
354     AC_DEFINE([USE_QUARTZ], 1,
355               [Use Core Graphics (Quartz) for loading image data])
356     COGL_IMAGE_BACKEND="quartz"
357   ],
358   [
359     EXPERIMENTAL_CONFIG=yes
360     EXPERIMENTAL_OPTIONS="$EXPERIMENTAL_OPTIONS fallback image decoding (stb_image),"
361     AC_DEFINE([USE_INTERNAL], 1,
362               [Use internal image decoding for loading image data])
363     COGL_IMAGE_BACKEND="stb_image"
364   ]
365 )
366
367
368 dnl     ============================================================
369 dnl     Should cogl-pango be built?
370 dnl     ============================================================
371
372 AC_ARG_ENABLE(
373   [cogl-pango],
374   [AC_HELP_STRING([--enable-cogl-pango=@<:@no/yes@:>@], [Enable pango support @<:@default=yes@:>@])],
375   [],
376   enable_cogl_pango=yes
377 )
378 AM_CONDITIONAL([BUILD_COGL_PANGO], [test "x$enable_cogl_pango" = "xyes"])
379
380 AS_IF([test "x$enable_cogl_pango" = "xyes"],
381       [
382         COGL_PANGO_PKG_REQUIRES="$COGL_PANGO_PKG_REQUIRES pangocairo >= pangocairo_req_version"
383       ]
384 )
385
386 dnl     ============================================================
387 dnl     Should examples be installed?
388 dnl     ============================================================
389 AC_ARG_ENABLE(
390   [examples-install],
391   [AC_HELP_STRING([--enable-examples-install=@<:@no/yes@:>@], [Enable installation of examples @<:@default=no@:>@])],
392   [],
393   enable_examples_install=no
394 )
395 AM_CONDITIONAL([INSTALL_EXAMPLES], [test "x$enable_examples_install" = "xyes"])
396
397 dnl     ============================================================
398 dnl     Should glib be used?
399 dnl     ============================================================
400 AC_ARG_ENABLE(
401   [glib],
402   [AC_HELP_STRING([--enable-glib=@<:@no/yes@:>@], [Enable glib support @<:@default=yes@:>@])],
403   [],
404   enable_glib=yes
405 )
406 AM_CONDITIONAL([USE_GLIB], [test "x$enable_glib" = "xyes"])
407
408 AS_IF([test "x$enable_glib" = "xyes"],
409       [
410         COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_GLIB_SUPPORT"
411       ],
412       [
413         EXPERIMENTAL_CONFIG=yes
414         EXPERIMENTAL_OPTIONS="$EXPERIMENTAL_OPTIONS --disable-glib,"
415       ]
416 )
417
418 dnl     ============================================================
419 dnl     Determine which drivers and window systems we can support
420 dnl     ============================================================
421
422 dnl         ========================================================
423 dnl         Drivers first...
424 dnl         ========================================================
425 EGL_CHECKED=no
426
427 dnl This gets set to yes if Cogl directly links to the GL library API
428 dnl so it doesn't need to be dlopened. This currently happens on OSX
429 dnl and WGL where it's not clear if window system API can be separated
430 dnl from the GL API.
431 GL_LIBRARY_DIRECTLY_LINKED=no
432
433 enabled_drivers=""
434
435 HAVE_GLES1=0
436 AC_ARG_ENABLE(
437   [gles1],
438   [AC_HELP_STRING([--enable-gles1=@<:@no/yes@:>@], [Enable support for OpenGL-ES 1.1 @<:@default=no@:>@])],
439   [],
440   enable_gles1=no
441 )
442 AS_IF([test "x$enable_gles1" = "xyes"],
443       [
444         AS_IF([test "x$platform_win32" = "xyes"],
445               [AC_MSG_ERROR([GLES 1 not available for win32])])
446
447         enabled_drivers="$enabled_drivers gles1"
448
449         cogl_gl_headers="GLES/gl.h GLES/glext.h"
450
451         AC_DEFINE([HAVE_COGL_GLES], 1, [Have GLES 1.1 for rendering])
452         COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_GLES CLUTTER_COGL_HAS_GLES"
453         COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_GLES1"
454         HAVE_GLES1=1
455
456         PKG_CHECK_EXISTS([glesv1_cm],
457           [COGL_PKG_REQUIRES_GL="$COGL_PKG_REQUIRES_GL glesv1_cm"
458            COGL_GLES1_LIBNAME="libGLESv1_CM.so"
459            NEED_EGL=yes
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         AS_IF([test "x$platform_win32" = "xyes"],
526               [AC_MSG_ERROR([GLES 2 not available for win32])])
527
528         enabled_drivers="$enabled_drivers gles2"
529
530         cogl_gl_headers="GLES2/gl2.h GLES2/gl2ext.h"
531         AC_DEFINE([HAVE_COGL_GLES2], 1, [Have GLES 2.0 for rendering])
532         COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_GLES CLUTTER_COGL_HAS_GLES"
533         COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_GLES2"
534         HAVE_GLES2=1
535
536         PKG_CHECK_EXISTS([glesv2],
537           [COGL_PKG_REQUIRES_GL="$COGL_PKG_REQUIRES_GL glesv2"
538            COGL_GLES2_LIBNAME="libGLESv2.so"
539           ],
540           [
541             # We have to check the two headers independently as GLES2/gl2ext.h
542             # needs to include GLES2/gl2.h to have the GL types defined (eg.
543             # GLenum).
544             AC_CHECK_HEADER([GLES2/gl2.h],
545                             [],
546                             [AC_MSG_ERROR([Unable to locate GLES2/gl2.h])])
547             AC_CHECK_HEADER([GLES2/gl2ext.h],
548                             [],
549                             [AC_MSG_ERROR([Unable to locate GLES2/gl2ext.h])],
550                             [#include <GLES2/gl2.h>])
551
552             COGL_GLES2_LIBNAME="libGLESv2.so"
553           ])
554
555         NEED_EGL=yes
556       ])
557
558 HAVE_GL=0
559 AC_ARG_ENABLE(
560   [gl],
561   [AC_HELP_STRING([--enable-gl=@<:@no/yes@:>@], [Enable support for OpenGL @<:@default=yes@:>@])],
562   [],
563   [enable_gl=yes]
564 )
565 AS_IF([test "x$enable_gl" = "xyes"],
566       [
567         enabled_drivers="$enabled_drivers gl"
568
569         PKG_CHECK_EXISTS([x11], [ALLOW_GLX=yes])
570
571         cogl_gl_headers="GL/gl.h"
572
573         AS_IF([test "x$platform_quartz" = "xyes"],
574               [
575                 cogl_gl_headers="OpenGL/gl.h"
576                 COGL_EXTRA_LDFLAGS="$COGL_EXTRA_LDFLAGS -framework OpenGL"
577                 dnl The GL API is being directly linked in so there is
578                 dnl no need to dlopen it separately
579                 GL_LIBRARY_DIRECTLY_LINKED=yes
580                 COGL_GL_LIBNAME=""
581               ],
582
583               [test "x$platform_win32" = "xyes"],
584               [
585                 COGL_EXTRA_LDFLAGS="$COGL_EXTRA_LDFLAGS -lopengl32 -lgdi32 -lwinmm"
586                 COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS -D_WIN32_WINNT=0x0500"
587                 ALLOW_WGL=yes
588                 dnl The GL API is being directly linked in so there is
589                 dnl no need to dlopen it separately
590                 GL_LIBRARY_DIRECTLY_LINKED=yes
591                 COGL_GL_LIBNAME=""
592               ],
593
594               [
595                 PKG_CHECK_EXISTS([gl],
596                   dnl We don't want to use COGL_PKG_REQUIRES here because we don't want to
597                   dnl directly link against libGL
598                   [COGL_PKG_REQUIRES_GL="$COGL_PKG_REQUIRES_GL gl"],
599                   [AC_CHECK_LIB(GL, [glGetString],
600                                 ,
601                                 [AC_MSG_ERROR([Unable to locate required GL library])])
602                   ])
603                 COGL_GL_LIBNAME="libGL.so.1"
604               ])
605
606         AC_DEFINE([HAVE_COGL_GL], [1], [Have GL for rendering])
607
608         COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_GL"
609         COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS CLUTTER_COGL_HAS_GL"
610         HAVE_GL=1
611       ])
612
613 AM_CONDITIONAL([COGL_DRIVER_GL_SUPPORTED], [test "x$enable_gl" = "xyes"])
614 AM_CONDITIONAL([COGL_DRIVER_GLES_SUPPORTED],
615                [test "x$enable_gles1" = "xyes" || test "x$enable_gles2" = "xyes"])
616
617 dnl Allow the GL library names to be overridden with configure options
618 AC_ARG_WITH([gl-libname],
619             [AS_HELP_STRING([--with-gl-libname],
620                             override the name of the GL library to dlopen)],
621             [COGL_GL_LIBNAME="$withval"])
622 AC_ARG_WITH([gles1-libname],
623             [AS_HELP_STRING([--with-gles1-libname],
624                             override the name of the GLESv1 library to dlopen)],
625             [COGL_GLES1_LIBNAME="$withval"])
626 AC_ARG_WITH([gles2-libname],
627             [AS_HELP_STRING([--with-gles2-libname],
628                             override the name of the GLESv2 library to dlopen)],
629             [COGL_GLES2_LIBNAME="$withval"])
630
631 AC_SUBST([COGL_GL_LIBNAME])
632 AC_SUBST([HAVE_GL])
633 AC_SUBST([COGL_GLES1_LIBNAME])
634 AC_SUBST([HAVE_GLES1])
635 AC_SUBST([COGL_GLES2_LIBNAME])
636 AC_SUBST([HAVE_GLES2])
637
638 if test "x$GL_LIBRARY_DIRECTLY_LINKED" = "xyes"; then
639    AC_DEFINE([HAVE_DIRECTLY_LINKED_GL_LIBRARY], [1],
640              [Defined if the GL library shouldn't be dlopened])
641 fi
642
643 dnl         ========================================================
644 dnl         Check window system integration libraries...
645 dnl         ========================================================
646
647 AC_ARG_ENABLE(
648   [glx],
649   [AC_HELP_STRING([--enable-glx=@<:@no/yes@:>@], [Enable support GLX @<:@default=auto@:>@])],
650   [],
651   [AS_IF([test "x$ALLOW_GLX" = "xyes"], [enable_glx=yes], [enable_glx=no])]
652 )
653 AS_IF([test "x$enable_glx" = "xyes"],
654       [
655         AS_IF([test "x$ALLOW_GLX" != "xyes"],
656               [AC_MSG_ERROR([GLX not supported with this configuration])])
657
658         NEED_XLIB=yes
659         SUPPORT_GLX=yes
660         GL_WINSYS_APIS="$GL_WINSYS_APIS glx"
661
662         COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_GLX_SUPPORT"
663
664         # We might fall back to DRM for sync-to-vblank on GLX
665         PKG_CHECK_EXISTS([libdrm],
666                          [
667                            AC_DEFINE([HAVE_DRM], [1], [Have libdrm support])
668                            COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES libdrm"
669                          ],
670                          [])
671       ])
672 AM_CONDITIONAL(SUPPORT_GLX, [test "x$SUPPORT_GLX" = "xyes"])
673
674 AC_ARG_ENABLE(
675   [wgl],
676   [AC_HELP_STRING([--enable-wgl=@<:@no/yes@:>@], [Enable support for WGL @<:@default=auto@:>@])],
677   [],
678   [AS_IF([test "x$ALLOW_WGL" = "xyes"], [enable_wgl=yes], [enable_wgl=no])]
679 )
680 AS_IF([test "x$enable_wgl" = "xyes"],
681       [
682         AS_IF([test "x$ALLOW_WGL" != "xyes"],
683               [AC_MSG_ERROR([WGL not supported with this configuration])])
684
685         SUPPORT_WGL=yes
686         GL_WINSYS_APIS="$GL_WINSYS_APIS wgl"
687
688         AC_DEFINE([COGL_HAS_WGL_SUPPORT], [1], [Cogl supports OpenGL using the WGL API])
689         COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_WIN32_SUPPORT"
690       ])
691 AM_CONDITIONAL(SUPPORT_WGL, [test "x$SUPPORT_WGL" = "xyes"])
692
693 EGL_PLATFORM_COUNT=0
694
695 AC_ARG_ENABLE(
696   [null-egl-platform],
697   [AC_HELP_STRING([--enable-null-egl-platform=@<:@no/yes@:>@], [Enable support for the NULL egl platform @<:@default=no@:>@])],
698   [],
699   enable_null_egl_platform=no
700 )
701 AS_IF([test "x$enable_null_egl_platform" = "xyes"],
702       [
703         EGL_PLATFORM_COUNT=$((EGL_PLATFORM_COUNT+1))
704         NEED_EGL=yes
705         EGL_PLATFORMS="$EGL_PLATFORMS null"
706
707         COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_EGL_PLATFORM_POWERVR_NULL_SUPPORT"
708       ])
709 AM_CONDITIONAL(SUPPORT_EGL_PLATFORM_POWERVR_NULL,
710                [test "x$enable_null_egl_platform" = "xyes"])
711
712 AC_ARG_ENABLE(
713   [gdl-egl-platform],
714   [AC_HELP_STRING([--enable-gdl-egl-platform=@<:@no/yes@:>@], [Enable support for the GDL egl platform @<:@default=no@:>@])],
715   [],
716   enable_gdl_egl_platform=no
717 )
718 AS_IF([test "x$enable_gdl_egl_platform" == "xyes"],
719       [
720         EGL_PLATFORM_COUNT=$((EGL_PLATFORM_COUNT+1))
721         NEED_EGL=yes
722         EGL_PLATFORMS="$EGL_PLATFORMS gdl"
723
724         AC_CHECK_HEADERS(
725           [libgdl.h],
726           [],
727           [
728             AC_CHECK_HEADERS(
729               [CE4100/libgdl.h],
730               [
731                COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS -I/usr/include/CE4100"
732               ],
733               [AC_MSG_ERROR([libgdl.h not found])])
734           ])
735
736         COGL_EXTRA_LDFLAGS="$COGL_EXTRA_LDFLAGS -lgdl"
737
738         COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_EGL_PLATFORM_GDL_SUPPORT"
739       ])
740 AM_CONDITIONAL(SUPPORT_EGL_PLATFORM_GDL,
741                [test "x$enable_gdl_egl_platform" = "xyes"])
742
743 AC_ARG_ENABLE(
744   [wayland-egl-platform],
745   [AC_HELP_STRING([--enable-wayland-egl-platform=@<:@no/yes@:>@], [Enable support for the Wayland egl platform @<:@default=no@:>@])],
746   [],
747   enable_wayland_egl_platform=no
748 )
749 AS_IF([test "x$enable_wayland_egl_platform" == "xyes"],
750       [
751         EGL_PLATFORM_COUNT=$((EGL_PLATFORM_COUNT+1))
752         NEED_EGL=yes
753         EGL_PLATFORMS="$EGL_PLATFORMS wayland"
754
755         PKG_CHECK_EXISTS([wayland-egl],
756                          [
757                            COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES wayland-egl"
758                            COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES wayland-client"
759                          ],
760                          [AC_MSG_ERROR([Unable to locate required wayland libraries])])
761
762         COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_EGL_PLATFORM_WAYLAND_SUPPORT"
763       ])
764 AM_CONDITIONAL(SUPPORT_EGL_PLATFORM_WAYLAND,
765                [test "x$enable_wayland_egl_platform" = "xyes"])
766
767
768 AC_ARG_ENABLE(
769   [kms-egl-platform],
770   [AC_HELP_STRING([--enable-kms-egl-platform=@<:@no/yes@:>@], [Enable support for the KMS egl platform @<:@default=no@:>@])],
771   [],
772   enable_kms_egl_platform=no
773 )
774 AS_IF([test "x$enable_kms_egl_platform" == "xyes"],
775       [
776         EGL_PLATFORM_COUNT=$((EGL_PLATFORM_COUNT+1))
777         NEED_EGL=yes
778         EGL_PLATFORMS="$EGL_PLATFORMS kms"
779
780         PKG_CHECK_EXISTS([gbm],
781                          [
782                            COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES gbm"
783                            COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES libdrm"
784                          ],
785                          [AC_MSG_ERROR([Unable to locate required kms libraries])])
786
787         COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_EGL_PLATFORM_KMS_SUPPORT"
788       ])
789 AM_CONDITIONAL(SUPPORT_EGL_PLATFORM_KMS,
790                [test "x$enable_kms_egl_platform" = "xyes"])
791
792 AC_ARG_ENABLE(
793   [wayland-egl-server],
794   [AC_HELP_STRING([--enable-wayland-egl-server=@<:@no/yes@:>@], [Enable server side wayland support @<:@default=no@:>@])],
795   [],
796   enable_wayland_egl_server=no
797 )
798 AS_IF([test "x$enable_wayland_egl_server" == "xyes"],
799       [
800         NEED_EGL=yes
801         COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES wayland-server"
802         COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_WAYLAND_EGL_SERVER_SUPPORT"
803       ])
804 AM_CONDITIONAL(SUPPORT_WAYLAND_EGL_SERVER,
805                [test "x$enable_wayland_egl_server" = "xyes"])
806
807 dnl Android EGL platform
808 AC_ARG_ENABLE(
809   [android-egl-platform],
810   [AC_HELP_STRING([--enable-android-egl-platform=@<:@no/yes@:>@], [Enable support for the Android egl platform @<:@default=no@:>@])],
811   [],
812   enable_android_egl_platform=no
813 )
814 AS_IF([test "x$enable_android_egl_platform" == "xyes"],
815       [
816         EGL_PLATFORM_COUNT=$((EGL_PLATFORM_COUNT+1))
817         NEED_EGL=yes
818         EGL_PLATFORMS="$EGL_PLATFORMS android"
819
820         AC_CHECK_HEADER([android/native_window.h],
821                         [],
822                         [AC_MSG_ERROR([Unable to locate android/native_window.h])])
823
824         COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_EGL_PLATFORM_ANDROID_SUPPORT"
825       ])
826 AM_CONDITIONAL(SUPPORT_EGL_PLATFORM_ANDROID,
827                [test "x$enable_android_egl_platform" = "xyes"])
828
829 dnl This should go last, since it's the default fallback and we need
830 dnl to check the value of $EGL_PLATFORM_COUNT here.
831 AC_ARG_ENABLE(
832   [xlib-egl-platform],
833   [AC_HELP_STRING([--enable-xlib-egl-platform=@<:@no/yes@:>@], [Enable support for the Xlib egl platform @<:@default=auto@:>@])],
834   [],
835   AS_IF([test "x$enable_gles1" = "xyes" -o "x$enable_gles2" = "xyes" && test $EGL_PLATFORM_COUNT -eq 0],
836         [enable_xlib_egl_platform=yes], [enable_xlib_egl_platform=no])
837 )
838 AS_IF([test "x$enable_xlib_egl_platform" = "xyes"],
839       [
840         EGL_PLATFORM_COUNT=$((EGL_PLATFORM_COUNT+1))
841         NEED_EGL=yes
842         NEED_XLIB=yes
843         EGL_PLATFORMS="$EGL_PLATFORMS xlib"
844
845         COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_EGL_PLATFORM_XLIB_SUPPORT"
846       ])
847 AM_CONDITIONAL(SUPPORT_EGL_PLATFORM_XLIB,
848                [test "x$enable_xlib_egl_platform" = "xyes"])
849
850 AS_IF([test "x$NEED_EGL" = "xyes" && test "x$EGL_CHECKED" != "xyes"],
851       [
852         PKG_CHECK_EXISTS([egl],
853           [COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES egl"],
854           [
855             AC_CHECK_HEADERS(
856               [EGL/egl.h],
857               [],
858               [AC_MSG_ERROR([Unable to locate required EGL headers])])
859             AC_CHECK_HEADERS(
860               [EGL/eglext.h],
861               [],
862               [AC_MSG_ERROR([Unable to locate required EGL headers])],
863               [#include <EGL/egl.h>])
864
865             AC_CHECK_LIB(EGL, [eglInitialize],
866               [COGL_EXTRA_LDFLAGS="$COGL_EXTRA_LDFLAGS -lEGL"],
867               [AC_MSG_ERROR([Unable to locate required EGL library])])
868
869             COGL_EXTRA_LDFLAGS="$COGL_EXTRA_LDFLAGS -lEGL"
870           ]
871           )
872
873         COGL_EGL_INCLUDES="#include <EGL/egl.h>
874 #include <EGL/eglext.h>"
875         AC_SUBST([COGL_EGL_INCLUDES])
876       ])
877
878 AS_IF([test "x$NEED_EGL" = "xyes"],
879       [
880         SUPPORT_EGL=yes
881         GL_WINSYS_APIS="$GL_WINSYS_APIS egl"
882         COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_EGL_SUPPORT"
883       ])
884
885 AM_CONDITIONAL(SUPPORT_EGL, [test "x$SUPPORT_EGL" = "xyes"])
886
887 AC_ARG_ENABLE(
888   [sdl],
889   [AC_HELP_STRING([--enable-sdl=@<:@no/yes@:>@], [Enable support SDL @<:@default=no@:>@])],
890   [],
891   [enable_sdl=no])
892 AS_IF([test "x$enable_sdl" = "xyes"],
893       [
894         PKG_CHECK_EXISTS([sdl],
895                          [],
896                          [AC_MSG_ERROR([SDL support requested but SDL not found])])
897
898         SUPPORT_SDL=yes
899         GL_WINSYS_APIS="$GL_WINSYS_APIS sdl"
900         COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES sdl"
901
902         COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_SDL_SUPPORT"
903       ],
904       [SUPPORT_SDL=no])
905 AM_CONDITIONAL(SUPPORT_SDL, [test "x$SUPPORT_SDL" = "xyes"])
906
907 dnl         ========================================================
908 dnl         Check X11 dependencies if required
909 dnl         ========================================================
910 AS_IF([test "x$NEED_XLIB" = "xyes"],
911       [
912         X11_MODULES="x11 xext xfixes >= xfixes_req_version xdamage xcomposite >= xcomposite_req_version"
913         PKG_CHECK_MODULES(DUMMY, [$X11_MODULES],
914                           [COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES $X11_MODULES"])
915         SUPPORT_X11=yes
916         SUPPORT_XLIB=yes
917
918         COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_X11"
919         COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_X11_SUPPORT"
920         COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_XLIB"
921         COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_XLIB_SUPPORT"
922       ])
923
924 AM_CONDITIONAL(X11_TESTS, [test "x$SUPPORT_X11" = "xyes"])
925 AM_CONDITIONAL(SUPPORT_X11, [test "x$SUPPORT_X11" = "xyes"])
926 AM_CONDITIONAL(SUPPORT_XLIB, [test "x$SUPPORT_XLIB" = "xyes"])
927
928
929 dnl ================================================================
930 dnl Compiler stuff.
931 dnl ================================================================
932 AC_PROG_CC
933 AC_PROG_CPP
934 AM_PROG_CC_C_O
935 AC_ISC_POSIX
936 AC_C_CONST
937
938
939 dnl ================================================================
940 dnl Libtool stuff.
941 dnl ================================================================
942 dnl AC_PROG_LIBTOOL
943 dnl LIBTOOL="$LIBTOOL --preserve-dup-deps"
944 LT_PREREQ([2.2.6])
945 LT_INIT([disable-static])
946
947 dnl ================================================================
948 dnl I18n stuff.
949 dnl ================================================================
950 AM_GNU_GETTEXT_VERSION([0.17])
951 AM_GNU_GETTEXT([external])
952
953 GETTEXT_PACKAGE="cogl"
954 AC_SUBST(GETTEXT_PACKAGE)
955 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,
956                    "$GETTEXT_PACKAGE",
957                    [The prefix for our gettext translation domains.])
958 AS_ALL_LINGUAS
959
960
961 dnl ================================================================
962 dnl Documentation stuff.
963 dnl ================================================================
964 # gtkdocize greps for ^GTK_DOC_CHECK and parses it, so you need to have
965 # it on it's own line.
966 m4_ifdef([GTK_DOC_CHECK], [
967 GTK_DOC_CHECK([gtk_doc_req_version], [--flavour no-tmpl])
968 ])
969 AM_CONDITIONAL([BUILD_GTK_DOC], [test "x$enable_gtk_doc" = "xyes"])
970
971 dnl ================================================================
972 dnl Check for dependency packages.
973 dnl ================================================================
974
975 dnl     ============================================================
976 dnl     Check glib dependencies
977 dnl     ============================================================
978 AM_PATH_GLIB_2_0([glib_req_version],
979                  [have_glib=yes], [have_glib=no],
980                  [gobject gthread gmodule-no-export])
981 AS_IF([test "x$have_glib" = "xno"], AC_MSG_ERROR([gobject-2.0 is required]))
982
983 COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES gobject-2.0 gmodule-no-export-2.0"
984 AC_SUBST(COGL_PKG_REQUIRES)
985 PKG_CHECK_MODULES(COGL_DEP, [$COGL_PKG_REQUIRES])
986 if test -n "$COGL_PKG_REQUIRES_GL"; then
987   PKG_CHECK_MODULES(COGL_DEP_GL, [$COGL_PKG_REQUIRES_GL])
988
989   dnl Strip out the GL libraries from the GL pkg-config files so we can
990   dnl dynamically load them instead
991   gl_libs=""
992   for x in $COGL_DEP_GL_LIBS; do
993     AS_CASE([$x],
994             [-lGL], [],
995             [-lGLESv2], [],
996             [-lGLESv1_CM], [],
997             [*], [gl_libs="$gl_libs $x"])
998   done
999   COGL_DEP_CFLAGS="$COGL_DEP_CFLAGS $COGL_DEP_CFLAGS_GL"
1000   COGL_DEP_LIBS="$COGL_DEP_LIBS $gl_libs"
1001 fi
1002 AC_SUBST(COGL_PANGO_PKG_REQUIRES)
1003
1004 AS_IF([test "x$enable_cogl_pango" = "xyes"],
1005   [PKG_CHECK_MODULES(COGL_PANGO_DEP, [$COGL_PANGO_PKG_REQUIRES])]
1006 )
1007
1008 dnl ================================================================
1009 dnl Misc program dependencies.
1010 dnl ================================================================
1011 AC_PROG_INSTALL
1012
1013 dnl ================================================================
1014 dnl GObject-Introspection check
1015 dnl ================================================================
1016 GOBJECT_INTROSPECTION_CHECK([gi_req_version])
1017
1018 dnl ================================================================
1019 dnl Checks for header files.
1020 dnl ================================================================
1021 AC_PATH_X
1022 AC_HEADER_STDC
1023 AC_CHECK_HEADERS(fcntl.h limits.h unistd.h)
1024
1025
1026 dnl ================================================================
1027 dnl Checks for library functions.
1028 dnl ================================================================
1029
1030 dnl The 'ffs' function is part of C99 so it isn't always
1031 dnl available. Cogl has a fallback if needed.
1032 AC_CHECK_FUNCS([ffs])
1033
1034 dnl ================================================================
1035 dnl Platform values
1036 dnl ================================================================
1037
1038 dnl These are values from system headers that we want to copy into the
1039 dnl public Cogl headers without having to include the system header
1040 AC_CHECK_HEADER(poll.h,
1041         [
1042          AC_COMPUTE_INT(COGL_SYSDEF_POLLIN, POLLIN, [#include <poll.h>],
1043                         AC_MSG_ERROR([Unable to get value of POLLIN]))
1044          AC_COMPUTE_INT(COGL_SYSDEF_POLLPRI, POLLPRI, [#include <poll.h>],
1045                         AC_MSG_ERROR([Unable to get value of POLLPRI]))
1046          AC_COMPUTE_INT(COGL_SYSDEF_POLLOUT, POLLOUT, [#include <poll.h>],
1047                         AC_MSG_ERROR([Unable to get value of POLLOUT]))
1048          AC_COMPUTE_INT(COGL_SYSDEF_POLLERR, POLLERR, [#include <poll.h>],
1049                         AC_MSG_ERROR([Unable to get value of POLLERR]))
1050          AC_COMPUTE_INT(COGL_SYSDEF_POLLHUP, POLLHUP, [#include <poll.h>],
1051                         AC_MSG_ERROR([Unable to get value of POLLHUP]))
1052          AC_COMPUTE_INT(COGL_SYSDEF_POLLNVAL, POLLNVAL, [#include <poll.h>],
1053                         AC_MSG_ERROR([Unable to get value of POLLNVAL]))
1054         ],
1055         [
1056          COGL_SYSDEF_POLLIN=1
1057          COGL_SYSDEF_POLLPRI=2
1058          COGL_SYSDEF_POLLOUT=4
1059          COGL_SYSDEF_POLLERR=8
1060          COGL_SYSDEF_POLLHUP=16
1061          COGL_SYSDEF_POLLNVAL=32
1062         ])
1063 COGL_DEFINES_EXTRA="$COGL_DEFINES_EXTRA
1064 #define COGL_SYSDEF_POLLIN $COGL_SYSDEF_POLLIN
1065 #define COGL_SYSDEF_POLLPRI $COGL_SYSDEF_POLLPRI
1066 #define COGL_SYSDEF_POLLOUT $COGL_SYSDEF_POLLOUT
1067 #define COGL_SYSDEF_POLLERR $COGL_SYSDEF_POLLERR
1068 #define COGL_SYSDEF_POLLHUP $COGL_SYSDEF_POLLHUP
1069 #define COGL_SYSDEF_POLLNVAL $COGL_SYSDEF_POLLNVAL
1070 "
1071
1072 dnl ================================================================
1073 dnl What needs to be substituted in other files
1074 dnl ================================================================
1075 COGL_DEFINES="$COGL_DEFINES_EXTRA"
1076 for x in $COGL_DEFINES_SYMBOLS; do
1077   COGL_DEFINES="$COGL_DEFINES
1078 #define $x 1"
1079 done;
1080 AC_SUBST(COGL_DEFINES)
1081
1082
1083 AS_IF([test "x$cogl_gl_headers" = "x"],
1084       [AC_MSG_ERROR([Internal error: no GL header set])])
1085 dnl cogl_gl_headers is a space separate list of headers to
1086 dnl include. We'll now convert them to a single variable with a
1087 dnl #include line for each header
1088 COGL_GL_HEADER_INCLUDES=""
1089 for x in $cogl_gl_headers; do
1090   COGL_GL_HEADER_INCLUDES="$COGL_GL_HEADER_INCLUDES
1091 #include <$x>"
1092 done;
1093 AC_SUBST(COGL_GL_HEADER_INCLUDES)
1094
1095 AC_DEFINE([COGL_ENABLE_EXPERIMENTAL_2_0_API], [1],
1096           [Can use Cogl 2.0 API internally])
1097 AC_DEFINE([COGL_ENABLE_EXPERIMENTAL_API], [1],
1098           [Can use experimental API internally])
1099
1100 AC_SUBST(COGL_DEP_CFLAGS)
1101 AC_SUBST(COGL_DEP_LIBS)
1102 AC_SUBST(COGL_PANGO_DEP_CFLAGS)
1103 AC_SUBST(COGL_PANGO_DEP_LIBS)
1104 AC_SUBST(COGL_EXTRA_CFLAGS)
1105 AC_SUBST(COGL_EXTRA_LDFLAGS)
1106
1107 # just for compatability with the clutter build...
1108 MAINTAINER_CFLAGS=
1109 AC_SUBST(MAINTAINER_CFLAGS)
1110
1111 AC_OUTPUT(
1112 Makefile
1113 README
1114 config.h.win32
1115 build/Makefile
1116 build/win32/Makefile
1117 build/win32/vs9/Makefile
1118 build/win32/vs10/Makefile
1119 cogl/Makefile
1120 cogl/cogl-1.0.pc
1121 cogl/cogl-2.0-experimental.pc
1122 cogl/cogl-defines.h
1123 cogl/cogl.rc
1124 cogl-pango/Makefile
1125 cogl-pango/cogl-pango-1.0.pc
1126 cogl-pango/cogl-pango-2.0-experimental.pc
1127 cogl-pango/cogl-pango.rc
1128 doc/Makefile
1129 doc/reference/Makefile
1130 doc/reference/cogl/Makefile
1131 doc/reference/cogl/cogl-docs.xml
1132 doc/reference/cogl-2.0-experimental/Makefile
1133 doc/reference/cogl-2.0-experimental/cogl-2.0-experimental-docs.xml
1134 examples/Makefile
1135 tests/Makefile
1136 tests/conform/Makefile
1137 tests/conform/config.env
1138 tests/conform/test-launcher.sh
1139 tests/data/Makefile
1140 po/Makefile.in
1141 )
1142
1143 dnl ================================================================
1144 dnl Dah Da!
1145 dnl ================================================================
1146 echo ""
1147 echo "Cogl - $COGL_1_VERSION/$COGL_VERSION (${COGL_RELEASE_STATUS})"
1148
1149 # Global flags
1150 echo ""
1151 echo " • Global:"
1152 echo "        Prefix: ${prefix}"
1153
1154 echo ""
1155 # Features
1156 echo " • Features:"
1157 echo "        Drivers: ${enabled_drivers}"
1158 AS_IF([test "x$GL_LIBRARY_DIRECTLY_LINKED" != xyes],
1159       [for driver in $enabled_drivers; do
1160          driver=`echo $driver | tr "[gles]" "[GLES]"`
1161          libname=`eval echo \\$COGL_${driver}_LIBNAME`
1162          echo "        Library name for $driver: $libname"
1163        done])
1164 echo "        GL Window System APIs:${GL_WINSYS_APIS}"
1165 if test "x$SUPPORT_EGL" = "xyes"; then
1166 echo "        EGL Platforms:${EGL_PLATFORMS}"
1167 echo "        Wayland compositor support: ${enable_wayland_egl_server}"
1168 fi
1169 echo "        Image backend: ${COGL_IMAGE_BACKEND}"
1170 echo "        Cogl Pango: ${enable_cogl_pango}"
1171 echo "        Profiling: ${enable_profile}"
1172
1173 # Compiler/Debug related flags
1174 echo ""
1175 echo " • Compiler options:"
1176 echo "        Cogl debug: ${enable_debug}"
1177 echo "        Enable deprecated symbols: ${enable_deprecated}"
1178 echo "        Compiler flags: ${CFLAGS} ${COGL_EXTRA_CFLAGS}"
1179 echo "        Linker flags: ${LDFLAGS} ${COGL_EXTRA_LDFLAGS}"
1180
1181 # Miscellaneous
1182 echo ""
1183 echo " • Extra:"
1184 echo "        Build API reference: ${enable_gtk_doc}"
1185 echo "        Build introspection data: ${enable_introspection}"
1186
1187 echo ""
1188
1189 # General warning about experimental features
1190 if test "x$EXPERIMENTAL_CONFIG" = "xyes"; then
1191 echo ""
1192 echo "☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠"
1193 echo " *WARNING*"
1194 echo ""
1195 echo "  The stability of your build might be affected by one or more"
1196 echo "  experimental configuration options."
1197 echo
1198 echo "  experimental options: $EXPERIMENTAL_OPTIONS"
1199 echo "☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠"
1200 echo ""
1201 fi