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], [10])
28 m4_define([cogl_1_micro_version], [2])
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], 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])
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])
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)
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])
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])
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}
109 AM_INIT_AUTOMAKE([1.11 foreign -Wno-portability no-define no-dist-gzip
110 dist-bzip2 tar-ustar])
111 AM_SILENT_RULES([yes])
113 AH_BOTTOM([#include "config-custom.h"])
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])
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])
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])
139 dnl ================================================================
140 dnl Export the source code release status
141 dnl ================================================================
142 AC_SUBST([COGL_RELEASE_STATUS], [cogl_release_status])
145 dnl ================================================================
146 dnl See what platform we are building for
147 dnl ================================================================
149 AC_MSG_CHECKING([if building for some Win32 platform])
151 [*-*-mingw*|*-*-cygwin*],
153 COGL_EXTRA_LDFLAGS="$COGL_EXTRA_LDFLAGS -no-undefined"
159 AC_MSG_RESULT([$platform_win32])
160 AM_CONDITIONAL(OS_WIN32, [test "$platform_win32" = "yes"])
162 AC_CHECK_HEADER([OpenGL/gl.h], [platform_quartz=yes], [platform_quartz=no])
163 AM_CONDITIONAL(OS_QUARTZ, [test "$platform_quartz" = "yes"])
165 dnl ================================================================
166 dnl Handle extra configure options
167 dnl ================================================================
169 dnl ============================================================
171 dnl ============================================================
172 m4_define([debug_default], [m4_if(cogl_release_status, [git], [yes], [no])])
175 [AC_HELP_STRING([--enable-debug=@<:@no/yes@:>@], [Control Cogl debugging level @<:@default=]debug_default[@:>@])],
177 enable_debug=debug_default
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"
188 COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS -DCOGL_ENABLE_DEBUG -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
190 [AC_MSG_ERROR([Unknown argument for --enable-debug])]
193 AC_SUBST(COGL_DEBUG_CFLAGS)
196 dnl ============================================================
197 dnl Enable cairo usage for debugging
198 dnl (debugging code can use cairo to dump the atlas)
199 dnl ============================================================
201 PKG_CHECK_EXISTS([CAIRO], [cairo >= cairo_req_version], [have_cairo=yes])
204 [AC_HELP_STRING([--enable-cairo=@<:@no/yes@:>@], [Control Cairo usage in Cogl debugging code @<:@default=auto@:>@])],
207 AS_IF([test "x$enable_debug" = "xyes"],
208 [enable_cairo=$have_cairo],
212 AS_IF([test "x$enable_cairo" = "xyes" && test "x$enable_debug" = "xyes"],
214 AS_IF([test "x$have_cairo" != "xyes"],
215 [AC_MSG_ERROR([Could not find Cairo])])
217 COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES cairo >= cairo_req_version"
218 AC_DEFINE([HAVE_CAIRO], [1], [Whether we have cairo or not])
222 dnl ============================================================
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@:>@])],
230 AS_IF([test "x$enable_profile" = "xyes"],
232 AS_IF([test "x$GCC" = "xyes"],
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"])
239 AC_MSG_ERROR([--enable-profile is currently only supported if using GCC])
242 AM_CONDITIONAL(PROFILE, test "x$enable_profile" != "xno")
245 dnl ============================================================
246 dnl Enable strict compiler flags
247 dnl ============================================================
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])])
254 [AC_HELP_STRING([--enable-maintainer-flags=@<:@no/yes/error@:>@], [Use strict compiler flags @<:@default=]maintainer_default[@:>@])],
256 enable_maintainer_flags=maintainer_default
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"
266 [$enable_maintainer_flags],
269 AS_COMPILER_FLAGS([MAINTAINER_CFLAGS], [$MAINTAINER_COMPILER_FLAGS])
276 MAINTAINER_COMPILER_FLAGS="$MAINTAINER_COMPILER_FLAGS -Werror"
277 AS_COMPILER_FLAGS([MAINTAINER_CFLAGS], [$MAINTAINER_COMPILER_FLAGS])
280 [AC_MSG_ERROR([Invalid option for --enable-maintainer-flags])]
283 # strip leading spaces
284 COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS ${MAINTAINER_CFLAGS#* }"
287 dnl ============================================================
288 dnl Enable deprecation guards
289 dnl ============================================================
291 # disable deprecated options from Glib only when building from git;
292 # the rules for distcheck will take care of turning this on when
294 m4_define([deprecated_default],
295 [m4_if(cogl_release_status, [git], [no], [yes])])
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[@:>@])],
301 [enable_deprecated=deprecated_default])
303 AS_CASE([$enable_deprecated],
307 DEPRECATED_CFLAGS="-DG_DISABLE_DEPRECATED -DG_DISABLE_SINGLE_INCLUDES"
315 [AC_MSG_ERROR([Unknown argument for --enable-deprecated])]
318 # strip leading spaces
319 COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS ${DEPRECATED_CFLAGS#* }"
321 dnl ============================================================
322 dnl Choose image loading backend
323 dnl ============================================================
326 [AC_HELP_STRING([--enable-gdk-pixbuf=@<:@no/yes@:>@], [Enable image loading via gdk-pixbuf @<:@default=yes@:>@])],
328 enable_gdk_pixbuf=yes
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])
338 [AC_HELP_STRING([--enable-quartz-image=@<:@no/yes@:>@], [Enable image loading via quartz @<:@default=no@:>@])],
340 enable_quartz_image=no
344 [test "x$have_gdk_pixbuf" = "xyes"],
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"
350 [test "x$enable_quartz_image" = "xyes"],
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"
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"
368 dnl ============================================================
369 dnl Should cogl-pango be built?
370 dnl ============================================================
374 [AC_HELP_STRING([--enable-cogl-pango=@<:@no/yes@:>@], [Enable pango support @<:@default=yes@:>@])],
376 enable_cogl_pango=yes
378 AM_CONDITIONAL([BUILD_COGL_PANGO], [test "x$enable_cogl_pango" = "xyes"])
380 AS_IF([test "x$enable_cogl_pango" = "xyes"],
382 COGL_PANGO_PKG_REQUIRES="$COGL_PANGO_PKG_REQUIRES pangocairo >= pangocairo_req_version"
386 dnl ============================================================
387 dnl Should examples be installed?
388 dnl ============================================================
391 [AC_HELP_STRING([--enable-examples-install=@<:@no/yes@:>@], [Enable installation of examples @<:@default=no@:>@])],
393 enable_examples_install=no
395 AM_CONDITIONAL([INSTALL_EXAMPLES], [test "x$enable_examples_install" = "xyes"])
397 dnl ============================================================
398 dnl Should glib be used?
399 dnl ============================================================
402 [AC_HELP_STRING([--enable-glib=@<:@no/yes@:>@], [Enable glib support @<:@default=yes@:>@])],
406 AM_CONDITIONAL([USE_GLIB], [test "x$enable_glib" = "xyes"])
408 AS_IF([test "x$enable_glib" = "xyes"],
410 COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_GLIB_SUPPORT"
413 EXPERIMENTAL_CONFIG=yes
414 EXPERIMENTAL_OPTIONS="$EXPERIMENTAL_OPTIONS --disable-glib,"
418 dnl ============================================================
419 dnl Determine which drivers and window systems we can support
420 dnl ============================================================
422 dnl ========================================================
424 dnl ========================================================
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
431 GL_LIBRARY_DIRECTLY_LINKED=no
438 [AC_HELP_STRING([--enable-gles1=@<:@no/yes@:>@], [Enable support for OpenGL-ES 1.1 @<:@default=no@:>@])],
442 AS_IF([test "x$enable_gles1" = "xyes"],
444 AS_IF([test "x$platform_win32" = "xyes"],
445 [AC_MSG_ERROR([GLES 1 not available for win32])])
447 enabled_drivers="$enabled_drivers gles1"
449 cogl_gl_headers="GLES/gl.h GLES/glext.h"
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"
456 PKG_CHECK_EXISTS([glesv1_cm],
457 [COGL_PKG_REQUIRES_GL="$COGL_PKG_REQUIRES_GL glesv1_cm"
458 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 AS_IF([test "x$platform_win32" = "xyes"],
526 [AC_MSG_ERROR([GLES 2 not available for win32])])
528 enabled_drivers="$enabled_drivers gles2"
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"
536 PKG_CHECK_EXISTS([glesv2],
537 [COGL_PKG_REQUIRES_GL="$COGL_PKG_REQUIRES_GL glesv2"
538 COGL_GLES2_LIBNAME="libGLESv2.so"
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.
544 AC_CHECK_HEADER([GLES2/gl2.h],
546 [AC_MSG_ERROR([Unable to locate GLES2/gl2.h])])
547 AC_CHECK_HEADER([GLES2/gl2ext.h],
549 [AC_MSG_ERROR([Unable to locate GLES2/gl2ext.h])],
550 [#include <GLES2/gl2.h>])
552 COGL_GLES2_LIBNAME="libGLESv2.so"
561 [AC_HELP_STRING([--enable-gl=@<:@no/yes@:>@], [Enable support for OpenGL @<:@default=yes@:>@])],
565 AS_IF([test "x$enable_gl" = "xyes"],
567 enabled_drivers="$enabled_drivers gl"
569 PKG_CHECK_EXISTS([x11], [ALLOW_GLX=yes])
571 cogl_gl_headers="GL/gl.h"
573 AS_IF([test "x$platform_quartz" = "xyes"],
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
583 [test "x$platform_win32" = "xyes"],
585 COGL_EXTRA_LDFLAGS="$COGL_EXTRA_LDFLAGS -lopengl32 -lgdi32 -lwinmm"
586 COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS -D_WIN32_WINNT=0x0500"
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
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],
601 [AC_MSG_ERROR([Unable to locate required GL library])])
603 COGL_GL_LIBNAME="libGL.so.1"
606 AC_DEFINE([HAVE_COGL_GL], [1], [Have GL for rendering])
608 COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_GL"
609 COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS CLUTTER_COGL_HAS_GL"
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"])
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"])
631 AC_SUBST([COGL_GL_LIBNAME])
633 AC_SUBST([COGL_GLES1_LIBNAME])
634 AC_SUBST([HAVE_GLES1])
635 AC_SUBST([COGL_GLES2_LIBNAME])
636 AC_SUBST([HAVE_GLES2])
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])
643 dnl ========================================================
644 dnl Check window system integration libraries...
645 dnl ========================================================
649 [AC_HELP_STRING([--enable-glx=@<:@no/yes@:>@], [Enable support GLX @<:@default=auto@:>@])],
651 [AS_IF([test "x$ALLOW_GLX" = "xyes"], [enable_glx=yes], [enable_glx=no])]
653 AS_IF([test "x$enable_glx" = "xyes"],
655 AS_IF([test "x$ALLOW_GLX" != "xyes"],
656 [AC_MSG_ERROR([GLX not supported with this configuration])])
660 GL_WINSYS_APIS="$GL_WINSYS_APIS glx"
662 COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_GLX_SUPPORT"
664 # We might fall back to DRM for sync-to-vblank on GLX
665 PKG_CHECK_EXISTS([libdrm],
667 AC_DEFINE([HAVE_DRM], [1], [Have libdrm support])
668 COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES libdrm"
672 AM_CONDITIONAL(SUPPORT_GLX, [test "x$SUPPORT_GLX" = "xyes"])
676 [AC_HELP_STRING([--enable-wgl=@<:@no/yes@:>@], [Enable support for WGL @<:@default=auto@:>@])],
678 [AS_IF([test "x$ALLOW_WGL" = "xyes"], [enable_wgl=yes], [enable_wgl=no])]
680 AS_IF([test "x$enable_wgl" = "xyes"],
682 AS_IF([test "x$ALLOW_WGL" != "xyes"],
683 [AC_MSG_ERROR([WGL not supported with this configuration])])
686 GL_WINSYS_APIS="$GL_WINSYS_APIS wgl"
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"
691 AM_CONDITIONAL(SUPPORT_WGL, [test "x$SUPPORT_WGL" = "xyes"])
697 [AC_HELP_STRING([--enable-null-egl-platform=@<:@no/yes@:>@], [Enable support for the NULL egl platform @<:@default=no@:>@])],
699 enable_null_egl_platform=no
701 AS_IF([test "x$enable_null_egl_platform" = "xyes"],
703 EGL_PLATFORM_COUNT=$((EGL_PLATFORM_COUNT+1))
705 EGL_PLATFORMS="$EGL_PLATFORMS null"
707 COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_EGL_PLATFORM_POWERVR_NULL_SUPPORT"
709 AM_CONDITIONAL(SUPPORT_EGL_PLATFORM_POWERVR_NULL,
710 [test "x$enable_null_egl_platform" = "xyes"])
714 [AC_HELP_STRING([--enable-gdl-egl-platform=@<:@no/yes@:>@], [Enable support for the GDL egl platform @<:@default=no@:>@])],
716 enable_gdl_egl_platform=no
718 AS_IF([test "x$enable_gdl_egl_platform" == "xyes"],
720 EGL_PLATFORM_COUNT=$((EGL_PLATFORM_COUNT+1))
722 EGL_PLATFORMS="$EGL_PLATFORMS gdl"
731 COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS -I/usr/include/CE4100"
733 [AC_MSG_ERROR([libgdl.h not found])])
736 COGL_EXTRA_LDFLAGS="$COGL_EXTRA_LDFLAGS -lgdl"
738 COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_EGL_PLATFORM_GDL_SUPPORT"
740 AM_CONDITIONAL(SUPPORT_EGL_PLATFORM_GDL,
741 [test "x$enable_gdl_egl_platform" = "xyes"])
744 [wayland-egl-platform],
745 [AC_HELP_STRING([--enable-wayland-egl-platform=@<:@no/yes@:>@], [Enable support for the Wayland egl platform @<:@default=no@:>@])],
747 enable_wayland_egl_platform=no
749 AS_IF([test "x$enable_wayland_egl_platform" == "xyes"],
751 EGL_PLATFORM_COUNT=$((EGL_PLATFORM_COUNT+1))
753 EGL_PLATFORMS="$EGL_PLATFORMS wayland"
755 PKG_CHECK_EXISTS([wayland-egl],
757 COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES wayland-egl"
758 COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES wayland-client"
760 [AC_MSG_ERROR([Unable to locate required wayland libraries])])
762 COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_EGL_PLATFORM_WAYLAND_SUPPORT"
764 AM_CONDITIONAL(SUPPORT_EGL_PLATFORM_WAYLAND,
765 [test "x$enable_wayland_egl_platform" = "xyes"])
770 [AC_HELP_STRING([--enable-kms-egl-platform=@<:@no/yes@:>@], [Enable support for the KMS egl platform @<:@default=no@:>@])],
772 enable_kms_egl_platform=no
774 AS_IF([test "x$enable_kms_egl_platform" == "xyes"],
776 EGL_PLATFORM_COUNT=$((EGL_PLATFORM_COUNT+1))
778 EGL_PLATFORMS="$EGL_PLATFORMS kms"
780 PKG_CHECK_EXISTS([gbm],
782 COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES gbm"
783 COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES libdrm"
785 [AC_MSG_ERROR([Unable to locate required kms libraries])])
787 COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_EGL_PLATFORM_KMS_SUPPORT"
789 AM_CONDITIONAL(SUPPORT_EGL_PLATFORM_KMS,
790 [test "x$enable_kms_egl_platform" = "xyes"])
793 [wayland-egl-server],
794 [AC_HELP_STRING([--enable-wayland-egl-server=@<:@no/yes@:>@], [Enable server side wayland support @<:@default=no@:>@])],
796 enable_wayland_egl_server=no
798 AS_IF([test "x$enable_wayland_egl_server" == "xyes"],
801 COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES wayland-server"
802 COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_WAYLAND_EGL_SERVER_SUPPORT"
804 AM_CONDITIONAL(SUPPORT_WAYLAND_EGL_SERVER,
805 [test "x$enable_wayland_egl_server" = "xyes"])
807 dnl Android EGL platform
809 [android-egl-platform],
810 [AC_HELP_STRING([--enable-android-egl-platform=@<:@no/yes@:>@], [Enable support for the Android egl platform @<:@default=no@:>@])],
812 enable_android_egl_platform=no
814 AS_IF([test "x$enable_android_egl_platform" == "xyes"],
816 EGL_PLATFORM_COUNT=$((EGL_PLATFORM_COUNT+1))
818 EGL_PLATFORMS="$EGL_PLATFORMS android"
820 AC_CHECK_HEADER([android/native_window.h],
822 [AC_MSG_ERROR([Unable to locate android/native_window.h])])
824 COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_EGL_PLATFORM_ANDROID_SUPPORT"
826 AM_CONDITIONAL(SUPPORT_EGL_PLATFORM_ANDROID,
827 [test "x$enable_android_egl_platform" = "xyes"])
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.
833 [AC_HELP_STRING([--enable-xlib-egl-platform=@<:@no/yes@:>@], [Enable support for the Xlib egl platform @<:@default=auto@:>@])],
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])
838 AS_IF([test "x$enable_xlib_egl_platform" = "xyes"],
840 EGL_PLATFORM_COUNT=$((EGL_PLATFORM_COUNT+1))
843 EGL_PLATFORMS="$EGL_PLATFORMS xlib"
845 COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_EGL_PLATFORM_XLIB_SUPPORT"
847 AM_CONDITIONAL(SUPPORT_EGL_PLATFORM_XLIB,
848 [test "x$enable_xlib_egl_platform" = "xyes"])
850 AS_IF([test "x$NEED_EGL" = "xyes" && test "x$EGL_CHECKED" != "xyes"],
852 PKG_CHECK_EXISTS([egl],
853 [COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES egl"],
858 [AC_MSG_ERROR([Unable to locate required EGL headers])])
862 [AC_MSG_ERROR([Unable to locate required EGL headers])],
863 [#include <EGL/egl.h>])
865 AC_CHECK_LIB(EGL, [eglInitialize],
866 [COGL_EXTRA_LDFLAGS="$COGL_EXTRA_LDFLAGS -lEGL"],
867 [AC_MSG_ERROR([Unable to locate required EGL library])])
869 COGL_EXTRA_LDFLAGS="$COGL_EXTRA_LDFLAGS -lEGL"
873 COGL_EGL_INCLUDES="#include <EGL/egl.h>
874 #include <EGL/eglext.h>"
875 AC_SUBST([COGL_EGL_INCLUDES])
878 AS_IF([test "x$NEED_EGL" = "xyes"],
881 GL_WINSYS_APIS="$GL_WINSYS_APIS egl"
882 COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_EGL_SUPPORT"
885 AM_CONDITIONAL(SUPPORT_EGL, [test "x$SUPPORT_EGL" = "xyes"])
889 [AC_HELP_STRING([--enable-sdl=@<:@no/yes@:>@], [Enable support SDL @<:@default=no@:>@])],
892 AS_IF([test "x$enable_sdl" = "xyes"],
894 PKG_CHECK_EXISTS([sdl],
896 [AC_MSG_ERROR([SDL support requested but SDL not found])])
899 GL_WINSYS_APIS="$GL_WINSYS_APIS sdl"
900 COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES sdl"
902 COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_SDL_SUPPORT"
905 AM_CONDITIONAL(SUPPORT_SDL, [test "x$SUPPORT_SDL" = "xyes"])
907 dnl ========================================================
908 dnl Check X11 dependencies if required
909 dnl ========================================================
910 AS_IF([test "x$NEED_XLIB" = "xyes"],
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"])
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"
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"])
929 dnl ================================================================
931 dnl ================================================================
939 dnl ================================================================
941 dnl ================================================================
943 dnl LIBTOOL="$LIBTOOL --preserve-dup-deps"
945 LT_INIT([disable-static])
947 dnl ================================================================
949 dnl ================================================================
950 AM_GNU_GETTEXT_VERSION([0.17])
951 AM_GNU_GETTEXT([external])
953 GETTEXT_PACKAGE="cogl"
954 AC_SUBST(GETTEXT_PACKAGE)
955 AC_DEFINE_UNQUOTED(GETTEXT_PACKAGE,
957 [The prefix for our gettext translation domains.])
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])
969 AM_CONDITIONAL([BUILD_GTK_DOC], [test "x$enable_gtk_doc" = "xyes"])
971 dnl ================================================================
972 dnl Check for dependency packages.
973 dnl ================================================================
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]))
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])
989 dnl Strip out the GL libraries from the GL pkg-config files so we can
990 dnl dynamically load them instead
992 for x in $COGL_DEP_GL_LIBS; do
997 [*], [gl_libs="$gl_libs $x"])
999 COGL_DEP_CFLAGS="$COGL_DEP_CFLAGS $COGL_DEP_CFLAGS_GL"
1000 COGL_DEP_LIBS="$COGL_DEP_LIBS $gl_libs"
1002 AC_SUBST(COGL_PANGO_PKG_REQUIRES)
1004 AS_IF([test "x$enable_cogl_pango" = "xyes"],
1005 [PKG_CHECK_MODULES(COGL_PANGO_DEP, [$COGL_PANGO_PKG_REQUIRES])]
1008 dnl ================================================================
1009 dnl Misc program dependencies.
1010 dnl ================================================================
1013 dnl ================================================================
1014 dnl GObject-Introspection check
1015 dnl ================================================================
1016 GOBJECT_INTROSPECTION_CHECK([gi_req_version])
1018 dnl ================================================================
1019 dnl Checks for header files.
1020 dnl ================================================================
1023 AC_CHECK_HEADERS(fcntl.h limits.h unistd.h)
1026 dnl ================================================================
1027 dnl Checks for library functions.
1028 dnl ================================================================
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])
1034 dnl ================================================================
1036 dnl ================================================================
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,
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]))
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
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
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
1080 AC_SUBST(COGL_DEFINES)
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
1093 AC_SUBST(COGL_GL_HEADER_INCLUDES)
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])
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)
1107 # just for compatability with the clutter build...
1109 AC_SUBST(MAINTAINER_CFLAGS)
1116 build/win32/Makefile
1117 build/win32/vs9/Makefile
1118 build/win32/vs10/Makefile
1121 cogl/cogl-2.0-experimental.pc
1125 cogl-pango/cogl-pango-1.0.pc
1126 cogl-pango/cogl-pango-2.0-experimental.pc
1127 cogl-pango/cogl-pango.rc
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
1136 tests/conform/Makefile
1137 tests/conform/config.env
1138 tests/conform/test-launcher.sh
1143 dnl ================================================================
1145 dnl ================================================================
1147 echo "Cogl - $COGL_1_VERSION/$COGL_VERSION (${COGL_RELEASE_STATUS})"
1152 echo " Prefix: ${prefix}"
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"
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}"
1169 echo " Image backend: ${COGL_IMAGE_BACKEND}"
1170 echo " Cogl Pango: ${enable_cogl_pango}"
1171 echo " Profiling: ${enable_profile}"
1173 # Compiler/Debug related flags
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}"
1184 echo " Build API reference: ${enable_gtk_doc}"
1185 echo " Build introspection data: ${enable_introspection}"
1189 # General warning about experimental features
1190 if test "x$EXPERIMENTAL_CONFIG" = "xyes"; then
1192 echo "☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠"
1195 echo " The stability of your build might be affected by one or more"
1196 echo " experimental configuration options."
1198 echo " experimental options: $EXPERIMENTAL_OPTIONS"
1199 echo "☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠☠"