3
dnl ================================================================
4
dnl XXX: If you are making a release then you need to check these
6
dnl » API versions (Only the 1.x version needs to change)
7
dnl (the pretty numbers that the users see)
9
dnl » Interface version details for libtool
10
dnl (the shared library versioning information)
12
dnl » Source code release status
13
dnl (mark the source code as being part of a "release" or from "git")
14
dnl ================================================================
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])
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])
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.
41
# For reference on how the various numbers should be updated at
42
# release time these rules are adapted from the libtool info pages:
44
# 1. Update the version information only immediately before a public
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').
50
# 3. If any interfaces have been added, removed, or changed since the
51
# last update, increment CURRENT, and set REVISION to 0.
53
# 4. If any interfaces have been added since the last public release,
56
# 5. If any interfaces have been removed since the last public release,
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])
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.
74
# Possible status values are: git, snapshot or release
76
m4_define([cogl_release_status], [git])
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)
86
dnl ================================================================
87
dnl Check that we are configured by mutter
88
dnl ================================================================
90
AC_ARG_VAR([MUTTER_VERSION])
91
AC_ARG_VAR([LIBMUTTER_API_VERSION])
93
AS_IF([test "x$MUTTER_VERSION" = "x"],
94
[AC_MSG_ERROR([Clutter can only be configured by mutter])],)
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])
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])
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}
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])
129
AH_BOTTOM([#include "config-custom.h"])
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])
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])
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])
155
dnl ================================================================
156
dnl Export the source code release status
157
dnl ================================================================
158
AC_SUBST([COGL_RELEASE_STATUS], [cogl_release_status])
160
dnl ================================================================
162
dnl ================================================================
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, "");],
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])])
181
dnl ================================================================
183
dnl ================================================================
185
dnl LIBTOOL="$LIBTOOL --preserve-dup-deps"
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])
192
dnl ================================================================
193
dnl Find an appropriate libm, for sin() etc.
194
dnl ================================================================
198
dnl ================================================================
199
dnl See what platform we are building for
200
dnl ================================================================
203
dnl ============================================================
205
dnl ============================================================
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)
213
dnl ============================================================
215
dnl ============================================================
216
m4_define([debug_default], [m4_if(cogl_release_status, [git], [yes], [no])])
219
[AC_HELP_STRING([--enable-debug=@<:@no/yes@:>@], [Control Cogl debugging level @<:@default=]debug_default[@:>@])],
221
enable_debug=debug_default
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"
232
COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
234
[AC_MSG_ERROR([Unknown argument for --enable-debug])]
237
AC_SUBST(COGL_DEBUG_CFLAGS)
241
[AC_HELP_STRING([--enable-unit-tests=@<:@no/yes@:>@], [Build Cogl unit tests @<:@default=yes@:>@])],
243
enable_unit_tests=yes
245
AS_IF([test "x$enable_unit_tests" = "xyes"],
247
AC_DEFINE([ENABLE_UNIT_TESTS], [1], [Whether to enable building unit tests])
250
AM_CONDITIONAL(UNIT_TESTS, test "x$enable_unit_tests" = "xyes")
252
dnl ============================================================
253
dnl Enable cairo usage for debugging
254
dnl (debugging code can use cairo to dump the atlas)
255
dnl ============================================================
257
PKG_CHECK_EXISTS([CAIRO], [cairo >= cairo_req_version], [have_cairo=yes])
260
[AC_HELP_STRING([--enable-cairo=@<:@no/yes@:>@], [Control Cairo usage in Cogl debugging code @<:@default=auto@:>@])],
263
AS_IF([test "x$enable_debug" = "xyes"],
264
[enable_cairo=$have_cairo],
268
AS_IF([test "x$enable_cairo" = "xyes" && test "x$enable_debug" = "xyes"],
270
AS_IF([test "x$have_cairo" != "xyes"],
271
[AC_MSG_ERROR([Could not find Cairo])])
273
COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES cairo >= cairo_req_version"
274
AC_DEFINE([HAVE_CAIRO], [1], [Whether we have cairo or not])
278
dnl ============================================================
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@:>@])],
286
AS_IF([test "x$enable_profile" = "xyes"],
288
AS_IF([test "x$GCC" = "xyes"],
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"])
295
AC_MSG_ERROR([--enable-profile is currently only supported if using GCC])
298
AM_CONDITIONAL(PROFILE, test "x$enable_profile" != "xno")
301
dnl ============================================================
302
dnl Enable strict compiler flags
303
dnl ============================================================
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])])
310
[AC_HELP_STRING([--enable-maintainer-flags=@<:@no/yes/error@:>@], [Use strict compiler flags @<:@default=]maintainer_default[@:>@])],
312
enable_maintainer_flags=maintainer_default
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"
323
[$enable_maintainer_flags],
326
AS_COMPILER_FLAGS([MAINTAINER_CFLAGS], [$MAINTAINER_COMPILER_FLAGS])
333
MAINTAINER_COMPILER_FLAGS="$MAINTAINER_COMPILER_FLAGS -Werror"
334
AS_COMPILER_FLAGS([MAINTAINER_CFLAGS], [$MAINTAINER_COMPILER_FLAGS])
337
[AC_MSG_ERROR([Invalid option for --enable-maintainer-flags])]
340
# strip leading spaces
341
COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS ${MAINTAINER_CFLAGS#* }"
342
COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS -Wno-error=sign-compare"
345
dnl ============================================================
346
dnl Enable deprecation guards
347
dnl ============================================================
349
# disable deprecated options from Glib only when building from git;
350
# the rules for distcheck will take care of turning this on when
352
m4_define([deprecated_default],
353
[m4_if(cogl_release_status, [git], [no], [yes])])
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[@:>@])],
359
[enable_deprecated=deprecated_default])
361
AS_CASE([$enable_deprecated],
365
DEPRECATED_CFLAGS="-DG_DISABLE_DEPRECATED -DG_DISABLE_SINGLE_INCLUDES"
373
[AC_MSG_ERROR([Unknown argument for --enable-deprecated])]
376
# strip leading spaces
377
COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS ${DEPRECATED_CFLAGS#* }"
379
dnl ================================================================
380
dnl Check for dependency packages.
381
dnl ================================================================
383
AM_PATH_GLIB_2_0([glib_req_version],
385
[AC_MSG_ERROR([glib-2.0 is required])],
386
[gobject gthread gmodule-no-export])
388
COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES gobject-2.0 gmodule-no-export-2.0"
390
dnl ============================================================
391
dnl Should cogl-pango be built?
392
dnl ============================================================
396
[AC_HELP_STRING([--enable-cogl-pango=@<:@no/yes@:>@], [Enable pango support @<:@default=yes@:>@])],
398
enable_cogl_pango=yes
400
AS_IF([test "x$enable_cogl_pango" = "xyes"],
402
COGL_PANGO_PKG_REQUIRES="$COGL_PANGO_PKG_REQUIRES pangocairo >= pangocairo_req_version"
406
dnl ============================================================
407
dnl Should cogl-path be built?
408
dnl ============================================================
412
[AC_HELP_STRING([--enable-cogl-path=@<:@no/yes@:>@], [Enable 2D path support @<:@default=yes@:>@])],
416
AS_IF([test "x$enable_cogl_path" = "xyes"],
418
COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_COGL_PATH_SUPPORT"
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"
428
dnl ============================================================
429
dnl Determine which drivers and window systems we can support
430
dnl ============================================================
432
dnl ========================================================
434
dnl ========================================================
442
[AC_HELP_STRING([--enable-gles1=@<:@no/yes@:>@], [Enable support for OpenGL-ES 1.1 @<:@default=no@:>@])],
446
AS_IF([test "x$enable_gles1" = "xyes"],
448
enabled_drivers="$enabled_drivers gles1"
450
cogl_gl_headers="GLES/gl.h GLES/glext.h"
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"
457
PKG_CHECK_EXISTS([glesv1_cm],
458
[COGL_PKG_REQUIRES_GL="$COGL_PKG_REQUIRES_GL glesv1_cm"
459
COGL_GLES1_LIBNAME="libGLESv1_CM.so"
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.
465
AC_CHECK_HEADER([GLES/gl.h],
467
[AC_MSG_ERROR([Unable to locate GLES/gl.h])])
468
AC_CHECK_HEADER([GLES/glext.h],
470
[AC_MSG_ERROR([Unable to locate GLES/glext.h])],
471
[#include <GLES/gl.h>])
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])
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"],
483
COGL_EGL_INCLUDES="#include <EGL/egl.h>"
485
[AC_MSG_ERROR([Unable to locate EGL header])])
486
AC_SUBST([COGL_EGL_INCLUDES])
488
AC_CHECK_HEADERS([EGL/eglext.h],
489
[COGL_EGL_INCLUDES="$COGL_EGL_INCLUDE
490
#include <EGL/eglext.h>"],
492
[$COGL_EGL_INCLUDES])
494
# Check for a GLES 1.x Common Profile library with/without EGL.
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"],
505
AC_CHECK_LIB(GLESv1_CM, [glFlush],
506
[COGL_GLES1_LIBNAME="libGLESv1_CM.so"
507
NEED_SEPARATE_EGL=yes
509
[AC_MSG_ERROR([Unable to locate required GLES 1.x Common Profile library])])
519
[AC_HELP_STRING([--enable-gles2=@<:@no/yes@:>@], [Enable support for OpenGL-ES 2.0 @<:@default=no@:>@])],
523
AS_IF([test "x$enable_gles2" = "xyes"],
525
enabled_drivers="$enabled_drivers gles2"
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"
533
PKG_CHECK_EXISTS([glesv2],
534
[COGL_PKG_REQUIRES_GL="$COGL_PKG_REQUIRES_GL glesv2"
535
COGL_GLES2_LIBNAME="libGLESv2.so"
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.
541
AC_CHECK_HEADER([GLES2/gl2.h],
543
[AC_MSG_ERROR([Unable to locate GLES2/gl2.h])])
544
AC_CHECK_HEADER([GLES2/gl2ext.h],
546
[AC_MSG_ERROR([Unable to locate GLES2/gl2ext.h])],
547
[#include <GLES2/gl2.h>])
549
COGL_GLES2_LIBNAME="libGLESv2.so"
556
[AC_HELP_STRING([--enable-gl=@<:@no/yes@:>@], [Enable support for OpenGL @<:@default=yes@:>@])],
560
AS_IF([test "x$enable_gl" = "xyes"],
562
enabled_drivers="$enabled_drivers gl"
564
PKG_CHECK_EXISTS([x11], [ALLOW_GLX=yes])
566
cogl_gl_headers="GL/gl.h"
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],
574
[AC_MSG_ERROR([Unable to locate required GL library])])
576
COGL_GL_LIBNAME="libGL.so.1"
578
AC_DEFINE([HAVE_COGL_GL], [1], [Have GL for rendering])
580
COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_GL"
581
COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS CLUTTER_COGL_HAS_GL"
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"])
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="" ])
608
AM_CONDITIONAL(HAVE_COGL_DEFAULT_DRIVER,
609
[ test "x$COGL_DEFAULT_DRIVER" != "x" ])
612
AC_SUBST([COGL_GL_LIBNAME])
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])
622
[AC_HELP_STRING([--enable-cogl-gles2=@<:@no/yes@:>@],
623
[Enable libcogl-gles2 frontend api for OpenGL-ES 2.0 @<:@default=auto@:>@])],
626
AS_IF([test "x$HAVE_GLES2" = "x1"],
627
[enable_cogl_gles2=yes],
628
[enable_cogl_gles2=no])
631
AS_IF([test "x$enable_cogl_gles2" = "xyes"],
633
AS_IF([test "x$HAVE_GLES2" != "x1"],
635
AC_MSG_ERROR([libcogl-gles2 is currently only supported on systems with a native GLES 2.0 library])
638
AM_CONDITIONAL([BUILD_COGL_GLES2], [test "x$enable_cogl_gles2" = "xyes"])
641
dnl ========================================================
642
dnl Check window system integration libraries...
643
dnl ========================================================
647
[AC_HELP_STRING([--enable-glx=@<:@no/yes@:>@], [Enable support GLX @<:@default=auto@:>@])],
649
[AS_IF([test "x$ALLOW_GLX" = "xyes"], [enable_glx=yes], [enable_glx=no])]
651
AS_IF([test "x$enable_glx" = "xyes"],
653
AS_IF([test "x$ALLOW_GLX" != "xyes"],
654
[AC_MSG_ERROR([GLX not supported with this configuration])])
658
GL_WINSYS_APIS="$GL_WINSYS_APIS glx"
660
COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_GLX_SUPPORT"
662
AM_CONDITIONAL(SUPPORT_GLX, [test "x$SUPPORT_GLX" = "xyes"])
668
[AC_HELP_STRING([--enable-kms-egl-platform=@<:@no/yes@:>@], [Enable support for the KMS egl platform @<:@default=no@:>@])],
670
enable_kms_egl_platform=yes
672
AS_IF([test "x$enable_kms_egl_platform" = "xyes"],
674
EGL_PLATFORM_COUNT=$((EGL_PLATFORM_COUNT+1))
676
EGL_PLATFORMS="$EGL_PLATFORMS kms"
678
PKG_CHECK_EXISTS([gbm],
680
COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES gbm"
681
COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES libdrm"
683
[AC_MSG_ERROR([Unable to locate required libgbm library for the KMS egl platform])])
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/-.*//'`
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])
694
COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_EGL_PLATFORM_KMS_SUPPORT"
696
AM_CONDITIONAL(SUPPORT_EGL_PLATFORM_KMS,
697
[test "x$enable_kms_egl_platform" = "xyes"])
700
[wayland-egl-server],
701
[AC_HELP_STRING([--enable-wayland-egl-server=@<:@no/yes@:>@], [Enable server side wayland support @<:@default=no@:>@])],
703
enable_wayland_egl_server=yes
705
AS_IF([test "x$enable_wayland_egl_server" = "xyes"],
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"
713
COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_WAYLAND_EGL_SERVER_SUPPORT"
715
AM_CONDITIONAL(SUPPORT_WAYLAND_EGL_SERVER,
716
[test "x$enable_wayland_egl_server" = "xyes"])
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.
722
[AC_HELP_STRING([--enable-xlib-egl-platform=@<:@no/yes@:>@], [Enable support for the Xlib egl platform @<:@default=auto@:>@])],
724
enable_xlib_egl_platform=yes
726
AS_IF([test "x$enable_xlib_egl_platform" = "xyes"],
728
EGL_PLATFORM_COUNT=$((EGL_PLATFORM_COUNT+1))
731
EGL_PLATFORMS="$EGL_PLATFORMS xlib"
733
COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_EGL_PLATFORM_XLIB_SUPPORT"
735
AM_CONDITIONAL(SUPPORT_EGL_PLATFORM_XLIB,
736
[test "x$enable_xlib_egl_platform" = "xyes"])
738
AS_IF([test "x$NEED_EGL" = "xyes" && test "x$EGL_CHECKED" != "xyes"],
740
PKG_CHECK_EXISTS([egl],
741
[COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES egl"],
746
[AC_MSG_ERROR([Unable to locate required EGL headers])])
750
[AC_MSG_ERROR([Unable to locate required EGL headers])],
751
[#include <EGL/egl.h>])
753
AC_CHECK_LIB(EGL, [eglInitialize],
754
[COGL_EXTRA_LDFLAGS="$COGL_EXTRA_LDFLAGS -lEGL"],
755
[AC_MSG_ERROR([Unable to locate required EGL library])])
757
COGL_EXTRA_LDFLAGS="$COGL_EXTRA_LDFLAGS -lEGL"
761
COGL_EGL_INCLUDES="#include <EGL/egl.h>
762
#include <EGL/eglext.h>"
763
AC_SUBST([COGL_EGL_INCLUDES])
766
AS_IF([test "x$NEED_EGL" = "xyes"],
769
GL_WINSYS_APIS="$GL_WINSYS_APIS egl"
770
COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_EGL_SUPPORT"
773
AM_CONDITIONAL(SUPPORT_EGL, [test "x$SUPPORT_EGL" = "xyes"])
775
dnl ========================================================
776
dnl Check X11 dependencies if required
777
dnl ========================================================
778
AS_IF([test "x$NEED_XLIB" = "xyes"],
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"])
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"
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"])
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)
805
AC_SUBST(COGL_PKG_REQUIRES)
806
if test -n "$COGL_PKG_REQUIRES"; then
807
PKG_CHECK_MODULES(COGL_DEP, [$COGL_PKG_REQUIRES])
809
if test -n "$COGL_PKG_REQUIRES_GL"; then
810
PKG_CHECK_MODULES(COGL_DEP_GL, [$COGL_PKG_REQUIRES_GL])
812
dnl Strip out the GL libraries from the GL pkg-config files so we can
813
dnl dynamically load them instead
815
for x in $COGL_DEP_GL_LIBS; do
820
[*], [gl_libs="$gl_libs $x"])
822
COGL_DEP_CFLAGS="$COGL_DEP_CFLAGS $COGL_DEP_CFLAGS_GL"
823
COGL_DEP_LIBS="$COGL_DEP_LIBS $gl_libs"
826
AC_SUBST(COGL_PANGO_PKG_REQUIRES)
828
AS_IF([test "x$enable_cogl_pango" = "xyes"],
829
[PKG_CHECK_MODULES(COGL_PANGO_DEP, [$COGL_PANGO_PKG_REQUIRES])]
831
AM_CONDITIONAL([BUILD_COGL_PANGO], [test "x$enable_cogl_pango" = "xyes"])
833
AM_CONDITIONAL([BUILD_COGL_PATH], [test "x$enable_cogl_path" = "xyes"])
835
dnl ================================================================
836
dnl Misc program dependencies.
837
dnl ================================================================
840
dnl ================================================================
841
dnl GObject-Introspection check
842
dnl ================================================================
843
GOBJECT_INTROSPECTION_CHECK([gi_req_version])
845
dnl ================================================================
846
dnl Checks for header files.
847
dnl ================================================================
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]))])
856
dnl ================================================================
857
dnl Checks for library functions.
858
dnl ================================================================
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])
864
dnl 'memmem' is a GNU extension but we have a simple fallback
865
AC_CHECK_FUNCS([memmem])
867
dnl This is used in the cogl-gles2-gears example but it is a GNU extension
870
AC_CHECK_FUNCS([sincos])
873
dnl ================================================================
875
dnl ================================================================
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
880
AC_CHECK_HEADER(poll.h,
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"
898
AS_IF([test "x$have_poll_h" = "xno"],
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
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
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
925
AC_SUBST(COGL_DEFINES)
926
AM_SUBST_NOTMAKE(COGL_DEFINES)
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
938
AC_SUBST(COGL_GL_HEADER_INCLUDES)
939
AM_SUBST_NOTMAKE(COGL_GL_HEADER_INCLUDES)
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)
950
# just for compatability with the clutter build...
952
AC_SUBST(MAINTAINER_CFLAGS)
956
test-fixtures/Makefile
958
cogl/mutter-cogl-$LIBMUTTER_API_VERSION.pc:cogl/mutter-cogl.pc.in
960
cogl/cogl-gl-header.h
961
cogl/cogl-egl-defines.h
963
cogl-pango/mutter-cogl-pango-$LIBMUTTER_API_VERSION.pc:cogl-pango/mutter-cogl-pango.pc.in
965
cogl-path/mutter-cogl-path-$LIBMUTTER_API_VERSION.pc:cogl-path/mutter-cogl-path.pc.in
967
cogl-gles2/mutter-cogl-gles2-$LIBMUTTER_API_VERSION.pc:cogl-gles2/mutter-cogl-gles2.pc.in
970
tests/conform/Makefile
972
tests/micro-perf/Makefile
976
dnl ================================================================
978
dnl ================================================================
980
echo "Cogl - $COGL_1_VERSION/$COGL_VERSION (${COGL_RELEASE_STATUS})"
985
echo " Prefix: ${prefix}"
986
if test "x$COGL_DEFAULT_DRIVER" != "x"; then
987
echo " Default driver: ${COGL_DEFAULT_DRIVER}"
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"
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}"
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}"
1009
# Compiler/Debug related flags
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}"
1021
echo " Build introspection data: ${enable_introspection}"
1022
echo " Build unit tests: ${enable_unit_tests}"