2011-02-09 21:32:11 -05:00
AC_PREREQ(2.59)
2018-05-07 10:14:29 -04:00
AC_INIT(cogl, [0.1])
2011-07-01 11:20:32 -04:00
AC_CONFIG_SRCDIR(cogl/cogl.h)
AC_CONFIG_AUX_DIR([build])
AC_CONFIG_MACRO_DIR([build/autotools])
2016-05-05 10:21:51 -04:00
AC_CONFIG_HEADERS(cogl-config.h)
2016-05-06 04:08:30 -04:00
AC_CONFIG_HEADERS(cogl-mutter-config.h)
2012-08-15 08:19:22 -04:00
AC_GNU_SOURCE
2011-02-09 21:32:11 -05:00
2016-11-25 11:16:07 -05:00
dnl ================================================================
dnl Check that we are configured by mutter
dnl ================================================================
AC_ARG_VAR([MUTTER_VERSION])
AC_ARG_VAR([LIBMUTTER_API_VERSION])
AS_IF([test "x$MUTTER_VERSION" = "x"],
[AC_MSG_ERROR([Clutter can only be configured by mutter])],)
2011-02-09 21:32:11 -05:00
dnl ================================================================
dnl Required versions for dependencies
dnl ================================================================
2012-09-13 12:43:11 -04:00
m4_define([glib_req_version], [2.32.0])
2011-02-09 21:32:11 -05:00
m4_define([pangocairo_req_version], [1.20])
m4_define([gi_req_version], [0.9.5])
m4_define([gdk_pixbuf_req_version], [2.0])
m4_define([uprof_req_version], [0.3])
m4_define([xfixes_req_version], [3])
m4_define([xcomposite_req_version], [0.4])
2012-11-12 11:31:16 -05:00
m4_define([xrandr_req_version], [1.2])
2011-07-01 11:20:32 -04:00
m4_define([cairo_req_version], [1.10])
2013-07-01 09:06:16 -04:00
m4_define([wayland_server_req_version], [1.1.90])
2014-11-17 09:49:20 -05:00
m4_define([mirclient_req_version], [0.9.0])
2011-07-01 11:20:32 -04:00
dnl These variables get copied into the generated README
AC_SUBST([GLIB_REQ_VERSION], [glib_req_version])
AC_SUBST([GDK_PIXBUF_REQ_VERSION], [gdk_pixbuf_req_version])
AC_SUBST([CAIRO_REQ_VERSION], [cairo_req_version])
AC_SUBST([PANGOCAIRO_REQ_VERSION], [pangocairo_req_version])
AC_SUBST([XCOMPOSITE_REQ_VERSION], [xcomposite_req_version])
AC_SUBST([XFIXES_REQ_VERSION], [xfixes_req_version])
AC_SUBST([GI_REQ_VERSION], [gi_req_version])
AC_SUBST([UPROF_REQ_VERSION], [uprof_req_version])
2013-07-01 09:06:16 -04:00
AC_SUBST([WAYLAND_SERVER_REQ_VERSION], [wayland_server_req_version])
2011-02-09 21:32:11 -05:00
# Save this value here, since automake will set cflags later and we
# want to know if the user specified custom cflags or not.
cflags_set=${CFLAGS+set}
2015-09-03 04:03:39 -04:00
AM_INIT_AUTOMAKE([1.14 foreign -Wno-portability no-define no-dist-gzip dist-xz tar-ustar subdir-objects])
2011-02-09 21:32:11 -05:00
AM_SILENT_RULES([yes])
2011-06-13 08:09:47 -04:00
AH_BOTTOM([#include "config-custom.h"])
2011-02-09 21:32:11 -05:00
2012-09-15 09:56:03 -04:00
dnl ================================================================
dnl Compiler stuff.
dnl ================================================================
AC_PROG_CC
AC_PROG_CPP
2012-09-16 21:20:10 -04:00
AC_PROG_CXX
2012-09-15 09:56:03 -04:00
AM_PROG_CC_C_O
AC_ISC_POSIX
AC_C_CONST
dnl ============================================================
dnl Compiler features
dnl ============================================================
AC_MSG_CHECKING([for _Static_assert])
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([_Static_assert (1, "");],
[(void) 0])],
2018-05-03 14:16:35 -04:00
[AC_MSG_RESULT([yes])],
[AC_MSG_ERROR([Missing _Static_assert])])
2012-09-15 09:56:03 -04:00
dnl ================================================================
dnl Libtool stuff.
dnl ================================================================
dnl AC_PROG_LIBTOOL
dnl LIBTOOL="$LIBTOOL --preserve-dup-deps"
LT_PREREQ([2.2.6])
LT_INIT([disable-static])
2012-09-19 08:50:04 -04:00
dnl when using libtool 2.x create libtool early, because it's used in the
dnl internal glib configure (as-glibconfig.m4)
m4_ifdef([LT_OUTPUT], [LT_OUTPUT])
2011-02-09 21:32:11 -05:00
2013-04-05 07:04:08 -04:00
dnl ================================================================
dnl Find an appropriate libm, for sin() etc.
dnl ================================================================
LT_LIB_M
AC_SUBST(LIBM)
2011-04-19 12:45:26 -04:00
dnl ================================================================
dnl See what platform we are building for
dnl ================================================================
AC_CANONICAL_HOST
2013-06-23 23:33:05 -04:00
dnl ============================================================
dnl Installed tests
dnl ============================================================
AC_ARG_ENABLE(installed_tests,
AS_HELP_STRING([--enable-installed-tests],
[Install test programs (default: no)]),,
[enable_installed_tests=no])
AM_CONDITIONAL(ENABLE_INSTALLED_TESTS, test x$enable_installed_tests = xyes)
2011-02-09 21:32:11 -05:00
dnl ============================================================
dnl Enable debugging
dnl ============================================================
2011-06-29 05:12:47 -04:00
m4_define([debug_default], [m4_if(cogl_release_status, [git], [yes], [no])])
2011-02-09 21:32:11 -05:00
AC_ARG_ENABLE(
[debug],
2011-06-29 05:12:47 -04:00
[AC_HELP_STRING([--enable-debug=@<:@no/yes@:>@], [Control Cogl debugging level @<:@default=]debug_default[@:>@])],
2011-02-09 21:32:11 -05:00
[],
2011-06-29 05:12:47 -04:00
enable_debug=debug_default
2011-02-09 21:32:11 -05:00
)
AS_CASE(
[$enable_debug],
[yes],
[
test "$cflags_set" = set || CFLAGS="$CFLAGS -g -O0"
2012-05-17 09:51:43 -04:00
COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS -DCOGL_GL_DEBUG -DCOGL_OBJECT_DEBUG -DCOGL_ENABLE_DEBUG"
2011-02-09 21:32:11 -05:00
],
[no],
[
2012-05-17 09:51:43 -04:00
COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS -DG_DISABLE_CHECKS -DG_DISABLE_CAST_CHECKS"
2011-02-09 21:32:11 -05:00
],
[AC_MSG_ERROR([Unknown argument for --enable-debug])]
)
AC_SUBST(COGL_DEBUG_CFLAGS)
2013-05-30 08:22:22 -04:00
AC_ARG_ENABLE(
[unit-tests],
[AC_HELP_STRING([--enable-unit-tests=@<:@no/yes@:>@], [Build Cogl unit tests @<:@default=yes@:>@])],
[],
enable_unit_tests=yes
)
AS_IF([test "x$enable_unit_tests" = "xyes"],
[
AC_DEFINE([ENABLE_UNIT_TESTS], [1], [Whether to enable building unit tests])
]
)
AM_CONDITIONAL(UNIT_TESTS, test "x$enable_unit_tests" = "xyes")
2011-02-09 21:32:11 -05:00
2011-05-27 08:59:29 -04:00
dnl ============================================================
dnl Enable cairo usage for debugging
dnl (debugging code can use cairo to dump the atlas)
dnl ============================================================
2011-07-01 11:20:32 -04:00
PKG_CHECK_EXISTS([CAIRO], [cairo >= cairo_req_version], [have_cairo=yes])
2011-05-27 08:59:29 -04:00
AC_ARG_ENABLE(
[cairo],
[AC_HELP_STRING([--enable-cairo=@<:@no/yes@:>@], [Control Cairo usage in Cogl debugging code @<:@default=auto@:>@])],
[],
[
AS_IF([test "x$enable_debug" = "xyes"],
[enable_cairo=$have_cairo],
[enable_cairo=no])
]
)
AS_IF([test "x$enable_cairo" = "xyes" && test "x$enable_debug" = "xyes"],
[
AS_IF([test "x$have_cairo" != "xyes"],
[AC_MSG_ERROR([Could not find Cairo])])
2011-07-01 11:20:32 -04:00
COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES cairo >= cairo_req_version"
2011-05-27 08:59:29 -04:00
AC_DEFINE([HAVE_CAIRO], [1], [Whether we have cairo or not])
])
2011-06-13 05:30:49 -04:00
dnl ============================================================
dnl Enable profiling
dnl ============================================================
AC_ARG_ENABLE(profile,
2011-07-10 20:13:09 -04:00
[AC_HELP_STRING([--enable-profile=@<:@no/yes@:>@],
2011-07-10 20:11:22 -04:00
[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@:>@])],
2011-06-13 05:30:49 -04:00
[],
[enable_profile=no])
AS_IF([test "x$enable_profile" = "xyes"],
[
AS_IF([test "x$GCC" = "xyes"],
[
COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES uprof-0.3"
COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS -DCOGL_ENABLE_PROFILE"
AS_IF([test "x$enable_debug" = "xyes"], [COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS -DUPROF_DEBUG"])
],
[
AC_MSG_ERROR([--enable-profile is currently only supported if using GCC])
])
])
AM_CONDITIONAL(PROFILE, test "x$enable_profile" != "xno")
2011-02-09 21:32:11 -05:00
dnl ============================================================
dnl Enable strict compiler flags
dnl ============================================================
# use strict compiler flags only when building from git; the rules for
# distcheck will take care of turning this on when making a release
2011-06-29 05:12:47 -04:00
m4_define([maintainer_default], [m4_if(cogl_release_status, [git], [yes], [no])])
2011-02-09 21:32:11 -05:00
AC_ARG_ENABLE(
[maintainer-flags],
2011-06-29 05:12:47 -04:00
[AC_HELP_STRING([--enable-maintainer-flags=@<:@no/yes/error@:>@], [Use strict compiler flags @<:@default=]maintainer_default[@:>@])],
2011-02-09 21:32:11 -05:00
[],
2011-06-29 05:12:47 -04:00
enable_maintainer_flags=maintainer_default
2011-02-09 21:32:11 -05:00
)
2015-06-10 12:51:03 -04:00
MAINTAINER_COMPILER_FLAGS="-Wall -Wcast-align -Wformat -Wformat-security
2015-06-10 10:32:18 -04:00
-Werror=uninitialized -Werror=no-strict-aliasing
-Werror=empty-body -Werror=init-self -Werror=undef
-Werror=declaration-after-statement -Werror=vla
2015-09-03 03:59:52 -04:00
-Werror=pointer-arith -Werror=missing-declarations
-Werror=maybe-uninitialized"
2011-02-09 21:32:11 -05:00
AS_CASE(
[$enable_maintainer_flags],
[yes],
[
AS_COMPILER_FLAGS([MAINTAINER_CFLAGS], [$MAINTAINER_COMPILER_FLAGS])
],
[no],
[
],
[error],
[
MAINTAINER_COMPILER_FLAGS="$MAINTAINER_COMPILER_FLAGS -Werror"
AS_COMPILER_FLAGS([MAINTAINER_CFLAGS], [$MAINTAINER_COMPILER_FLAGS])
],
[*],
[AC_MSG_ERROR([Invalid option for --enable-maintainer-flags])]
)
# strip leading spaces
2011-06-01 11:44:57 -04:00
COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS ${MAINTAINER_CFLAGS#* }"
2016-04-27 14:37:18 -04:00
COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS -Wno-error=sign-compare"
2011-02-09 21:32:11 -05:00
2011-09-27 05:27:19 -04:00
dnl ============================================================
dnl Enable deprecation guards
dnl ============================================================
# disable deprecated options from Glib only when building from git;
# the rules for distcheck will take care of turning this on when
# making a release
m4_define([deprecated_default],
[m4_if(cogl_release_status, [git], [no], [yes])])
AC_ARG_ENABLE([deprecated],
[AS_HELP_STRING([--enable-deprecated=@<:@no/yes@:>@],
[Whether deprecated symbols should be disabled when compiling Cogl @<:@default=]deprecated_default[@:>@])],
[],
[enable_deprecated=deprecated_default])
AS_CASE([$enable_deprecated],
[no],
[
DEPRECATED_CFLAGS="-DG_DISABLE_DEPRECATED -DG_DISABLE_SINGLE_INCLUDES"
],
[yes],
[
DEPRECATED_CFLAGS=""
],
[AC_MSG_ERROR([Unknown argument for --enable-deprecated])]
)
# strip leading spaces
COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS ${DEPRECATED_CFLAGS#* }"
2012-11-22 12:07:14 -05:00
dnl ================================================================
dnl Check for dependency packages.
dnl ================================================================
2016-04-11 11:52:46 -04:00
AM_PATH_GLIB_2_0([glib_req_version],
[],
[AC_MSG_ERROR([glib-2.0 is required])],
[gobject gthread gmodule-no-export])
2012-11-22 12:07:14 -05:00
2016-04-11 11:52:46 -04:00
COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES gobject-2.0 gmodule-no-export-2.0"
2012-11-22 12:07:14 -05:00
2018-05-03 14:51:04 -04:00
COGL_PANGO_PKG_REQUIRES="$COGL_PANGO_PKG_REQUIRES pangocairo >= pangocairo_req_version"
2012-11-22 12:07:14 -05:00
2011-02-09 21:32:11 -05:00
dnl ============================================================
dnl Choose image loading backend
dnl ============================================================
2016-04-11 11:52:46 -04:00
COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES gdk-pixbuf-2.0 >= gdk_pixbuf_req_version"
COGL_IMAGE_BACKEND="gdk-pixbuf"
2011-02-09 21:32:11 -05:00
dnl ============================================================
2011-03-10 10:15:08 -05:00
dnl Determine which drivers and window systems we can support
2011-02-09 21:32:11 -05:00
dnl ============================================================
2011-03-10 10:15:08 -05:00
dnl ========================================================
dnl Drivers first...
dnl ========================================================
EGL_CHECKED=no
2011-07-07 15:44:56 -04:00
enabled_drivers=""
2012-02-23 07:30:51 -05:00
HAVE_GLES2=0
2011-03-10 10:15:08 -05:00
AC_ARG_ENABLE(
[gles2],
[AC_HELP_STRING([--enable-gles2=@<:@no/yes@:>@], [Enable support for OpenGL-ES 2.0 @<:@default=no@:>@])],
[],
enable_gles2=no
)
AS_IF([test "x$enable_gles2" = "xyes"],
[
2011-07-07 15:44:56 -04:00
enabled_drivers="$enabled_drivers gles2"
2011-03-10 10:15:08 -05:00
cogl_gl_headers="GLES2/gl2.h GLES2/gl2ext.h"
AC_DEFINE([HAVE_COGL_GLES2], 1, [Have GLES 2.0 for rendering])
COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_GLES CLUTTER_COGL_HAS_GLES"
COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_GLES2"
2012-02-23 07:30:51 -05:00
HAVE_GLES2=1
2011-03-10 10:15:08 -05:00
2016-01-12 16:35:51 -05:00
PKG_CHECK_EXISTS([glesv2],
[COGL_PKG_REQUIRES_GL="$COGL_PKG_REQUIRES_GL glesv2"
COGL_GLES2_LIBNAME="libGLESv2.so"
],
[
# We have to check the two headers independently as GLES2/gl2ext.h
# needs to include GLES2/gl2.h to have the GL types defined (eg.
# GLenum).
AC_CHECK_HEADER([GLES2/gl2.h],
[],
[AC_MSG_ERROR([Unable to locate GLES2/gl2.h])])
AC_CHECK_HEADER([GLES2/gl2ext.h],
[],
[AC_MSG_ERROR([Unable to locate GLES2/gl2ext.h])],
[#include <GLES2/gl2.h>])
2011-03-10 10:15:08 -05:00
2016-01-12 16:35:51 -05:00
COGL_GLES2_LIBNAME="libGLESv2.so"
])
2011-03-10 10:15:08 -05:00
])
2012-02-23 07:30:51 -05:00
HAVE_GL=0
2011-03-10 10:15:08 -05:00
AC_ARG_ENABLE(
[gl],
[AC_HELP_STRING([--enable-gl=@<:@no/yes@:>@], [Enable support for OpenGL @<:@default=yes@:>@])],
[],
2011-07-07 15:44:56 -04:00
[enable_gl=yes]
2011-03-10 10:15:08 -05:00
)
AS_IF([test "x$enable_gl" = "xyes"],
[
2011-07-07 15:44:56 -04:00
enabled_drivers="$enabled_drivers gl"
2011-05-12 06:43:27 -04:00
PKG_CHECK_EXISTS([x11], [ALLOW_GLX=yes])
2011-03-10 10:15:08 -05:00
cogl_gl_headers="GL/gl.h"
2016-04-10 12:55:22 -04:00
PKG_CHECK_EXISTS([gl],
dnl We don't want to use COGL_PKG_REQUIRES here because we don't want to
dnl directly link against libGL
[COGL_PKG_REQUIRES_GL="$COGL_PKG_REQUIRES_GL gl"],
[AC_CHECK_LIB(GL, [glGetString],
,
[AC_MSG_ERROR([Unable to locate required GL library])])
])
COGL_GL_LIBNAME="libGL.so.1"
2011-03-10 10:15:08 -05:00
AC_DEFINE([HAVE_COGL_GL], [1], [Have GL for rendering])
COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_GL"
COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS CLUTTER_COGL_HAS_GL"
2012-02-23 07:30:51 -05:00
HAVE_GL=1
2011-03-10 10:15:08 -05:00
])
2011-07-07 15:44:56 -04:00
AM_CONDITIONAL([COGL_DRIVER_GL_SUPPORTED], [test "x$enable_gl" = "xyes"])
AM_CONDITIONAL([COGL_DRIVER_GLES_SUPPORTED],
[test "x$enable_gles1" = "xyes" || test "x$enable_gles2" = "xyes"])
2011-03-10 10:15:08 -05:00
2012-06-20 03:47:41 -04:00
dnl Allow the GL library names and default driver to be overridden with configure options
2011-07-18 13:47:44 -04:00
AC_ARG_WITH([gl-libname],
[AS_HELP_STRING([--with-gl-libname],
override the name of the GL library to dlopen)],
[COGL_GL_LIBNAME="$withval"])
AC_ARG_WITH([gles2-libname],
[AS_HELP_STRING([--with-gles2-libname],
override the name of the GLESv2 library to dlopen)],
[COGL_GLES2_LIBNAME="$withval"])
2012-06-20 03:47:41 -04:00
AC_ARG_WITH([default-driver],
[AS_HELP_STRING([--with-default-driver],
specify a default cogl driver)],
[COGL_DEFAULT_DRIVER="${withval}"],
[COGL_DEFAULT_DRIVER="" ])
AM_CONDITIONAL(HAVE_COGL_DEFAULT_DRIVER,
[ test "x$COGL_DEFAULT_DRIVER" != "x" ])
2011-07-18 13:47:44 -04:00
2011-07-07 15:44:56 -04:00
AC_SUBST([COGL_GL_LIBNAME])
2012-02-23 07:30:51 -05:00
AC_SUBST([HAVE_GL])
2011-07-07 15:44:56 -04:00
AC_SUBST([COGL_GLES2_LIBNAME])
2012-02-23 07:30:51 -05:00
AC_SUBST([HAVE_GLES2])
2012-06-20 03:47:41 -04:00
AC_SUBST([COGL_DEFAULT_DRIVER])
2011-03-10 10:15:08 -05:00
2012-03-23 21:41:48 -04:00
AC_ARG_ENABLE(
[cogl-gles2],
[AC_HELP_STRING([--enable-cogl-gles2=@<:@no/yes@:>@],
[Enable libcogl-gles2 frontend api for OpenGL-ES 2.0 @<:@default=auto@:>@])],
[],
[
AS_IF([test "x$HAVE_GLES2" = "x1"],
[enable_cogl_gles2=yes],
[enable_cogl_gles2=no])
]
)
AS_IF([test "x$enable_cogl_gles2" = "xyes"],
[
AS_IF([test "x$HAVE_GLES2" != "x1"],
[
AC_MSG_ERROR([libcogl-gles2 is currently only supported on systems with a native GLES 2.0 library])
])
])
AM_CONDITIONAL([BUILD_COGL_GLES2], [test "x$enable_cogl_gles2" = "xyes"])
2011-03-10 10:15:08 -05:00
dnl ========================================================
dnl Check window system integration libraries...
dnl ========================================================
AC_ARG_ENABLE(
[glx],
[AC_HELP_STRING([--enable-glx=@<:@no/yes@:>@], [Enable support GLX @<:@default=auto@:>@])],
[],
[AS_IF([test "x$ALLOW_GLX" = "xyes"], [enable_glx=yes], [enable_glx=no])]
)
AS_IF([test "x$enable_glx" = "xyes"],
[
AS_IF([test "x$ALLOW_GLX" != "xyes"],
2011-07-07 15:44:56 -04:00
[AC_MSG_ERROR([GLX not supported with this configuration])])
2011-03-10 10:15:08 -05:00
NEED_XLIB=yes
SUPPORT_GLX=yes
GL_WINSYS_APIS="$GL_WINSYS_APIS glx"
2011-07-13 06:43:49 -04:00
COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_GLX_SUPPORT"
2011-03-10 10:15:08 -05:00
])
AM_CONDITIONAL(SUPPORT_GLX, [test "x$SUPPORT_GLX" = "xyes"])
EGL_PLATFORM_COUNT=0
2011-05-24 20:37:56 -04:00
AC_ARG_ENABLE(
[wayland-egl-server],
[AC_HELP_STRING([--enable-wayland-egl-server=@<:@no/yes@:>@], [Enable server side wayland support @<:@default=no@:>@])],
[],
2016-04-08 13:58:20 -04:00
enable_wayland_egl_server=yes
2011-05-24 20:37:56 -04:00
)
2012-08-21 06:10:23 -04:00
AS_IF([test "x$enable_wayland_egl_server" = "xyes"],
2011-05-24 20:37:56 -04:00
[
NEED_EGL=yes
2013-01-04 12:21:22 -05:00
2013-03-20 12:36:58 -04:00
PKG_CHECK_MODULES(WAYLAND_SERVER,
2013-07-01 09:06:16 -04:00
[wayland-server >= wayland_server_req_version])
COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES wayland-server >= wayland_server_req_version"
2013-01-04 12:21:22 -05:00
2011-05-24 20:37:56 -04:00
COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_WAYLAND_EGL_SERVER_SUPPORT"
])
AM_CONDITIONAL(SUPPORT_WAYLAND_EGL_SERVER,
[test "x$enable_wayland_egl_server" = "xyes"])
2011-03-10 10:15:08 -05:00
dnl This should go last, since it's the default fallback and we need
dnl to check the value of $EGL_PLATFORM_COUNT here.
AC_ARG_ENABLE(
[xlib-egl-platform],
[AC_HELP_STRING([--enable-xlib-egl-platform=@<:@no/yes@:>@], [Enable support for the Xlib egl platform @<:@default=auto@:>@])],
[],
2016-04-08 13:58:20 -04:00
enable_xlib_egl_platform=yes
2011-03-10 10:15:08 -05:00
)
AS_IF([test "x$enable_xlib_egl_platform" = "xyes"],
[
EGL_PLATFORM_COUNT=$((EGL_PLATFORM_COUNT+1))
NEED_EGL=yes
NEED_XLIB=yes
EGL_PLATFORMS="$EGL_PLATFORMS xlib"
2011-12-13 11:23:25 -05:00
COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_EGL_PLATFORM_XLIB_SUPPORT"
2011-03-10 10:15:08 -05:00
])
2011-12-13 11:23:25 -05:00
AM_CONDITIONAL(SUPPORT_EGL_PLATFORM_XLIB,
2011-03-10 10:15:08 -05:00
[test "x$enable_xlib_egl_platform" = "xyes"])
AS_IF([test "x$NEED_EGL" = "xyes" && test "x$EGL_CHECKED" != "xyes"],
[
PKG_CHECK_EXISTS([egl],
[COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES egl"],
[
AC_CHECK_HEADERS(
2011-07-22 10:13:44 -04:00
[EGL/egl.h],
2011-03-10 10:15:08 -05:00
[],
[AC_MSG_ERROR([Unable to locate required EGL headers])])
2011-07-22 10:13:44 -04:00
AC_CHECK_HEADERS(
[EGL/eglext.h],
[],
[AC_MSG_ERROR([Unable to locate required EGL headers])],
[#include <EGL/egl.h>])
2011-03-10 10:15:08 -05:00
AC_CHECK_LIB(EGL, [eglInitialize],
[COGL_EXTRA_LDFLAGS="$COGL_EXTRA_LDFLAGS -lEGL"],
[AC_MSG_ERROR([Unable to locate required EGL library])])
COGL_EXTRA_LDFLAGS="$COGL_EXTRA_LDFLAGS -lEGL"
]
)
2011-05-24 16:33:22 -04:00
COGL_EGL_INCLUDES="#include <EGL/egl.h>
#include <EGL/eglext.h>"
AC_SUBST([COGL_EGL_INCLUDES])
])
2011-05-12 10:51:01 -04:00
AS_IF([test "x$NEED_EGL" = "xyes"],
[
2011-03-10 10:15:08 -05:00
SUPPORT_EGL=yes
GL_WINSYS_APIS="$GL_WINSYS_APIS egl"
2011-04-18 10:57:32 -04:00
COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_EGL_SUPPORT"
2011-03-10 10:15:08 -05:00
])
2011-05-12 10:51:01 -04:00
2011-03-10 10:15:08 -05:00
AM_CONDITIONAL(SUPPORT_EGL, [test "x$SUPPORT_EGL" = "xyes"])
dnl ========================================================
dnl Check X11 dependencies if required
dnl ========================================================
AS_IF([test "x$NEED_XLIB" = "xyes"],
[
2012-11-12 11:31:16 -05:00
X11_MODULES="x11 xext xfixes >= xfixes_req_version xdamage xcomposite >= xcomposite_req_version xrandr >= xrandr_req_version"
2011-03-10 10:15:08 -05:00
PKG_CHECK_MODULES(DUMMY, [$X11_MODULES],
[COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES $X11_MODULES"])
SUPPORT_X11=yes
SUPPORT_XLIB=yes
COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_X11"
COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_X11_SUPPORT"
COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_XLIB"
COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_XLIB_SUPPORT"
])
AM_CONDITIONAL(X11_TESTS, [test "x$SUPPORT_X11" = "xyes"])
AM_CONDITIONAL(SUPPORT_X11, [test "x$SUPPORT_X11" = "xyes"])
AM_CONDITIONAL(SUPPORT_XLIB, [test "x$SUPPORT_XLIB" = "xyes"])
2011-02-09 21:32:11 -05:00
dnl ================================================================
dnl Documentation stuff.
dnl ================================================================
2012-12-31 18:24:26 -05:00
GLIB_PREFIX="`$PKG_CONFIG --variable=prefix glib-2.0`"
GDKPIXBUF_PREFIX="`$PKG_CONFIG --variable=prefix gdk-pixbuf-2.0`"
AC_SUBST(GLIB_PREFIX)
AC_SUBST(GDKPIXBUF_PREFIX)
2011-02-09 21:32:11 -05:00
AC_SUBST(COGL_PKG_REQUIRES)
2013-04-27 21:42:24 -04:00
if test -n "$COGL_PKG_REQUIRES"; then
PKG_CHECK_MODULES(COGL_DEP, [$COGL_PKG_REQUIRES])
if test -n "$COGL_PKG_REQUIRES_GL"; then
PKG_CHECK_MODULES(COGL_DEP_GL, [$COGL_PKG_REQUIRES_GL])
dnl Strip out the GL libraries from the GL pkg-config files so we can
dnl dynamically load them instead
gl_libs=""
for x in $COGL_DEP_GL_LIBS; do
AS_CASE([$x],
[-lGL], [],
[-lGLESv2], [],
[-lGLESv1_CM], [],
[*], [gl_libs="$gl_libs $x"])
done
COGL_DEP_CFLAGS="$COGL_DEP_CFLAGS $COGL_DEP_CFLAGS_GL"
COGL_DEP_LIBS="$COGL_DEP_LIBS $gl_libs"
fi
2011-07-07 15:44:56 -04:00
fi
2011-08-02 09:14:06 -04:00
AC_SUBST(COGL_PANGO_PKG_REQUIRES)
2011-12-19 11:01:37 -05:00
2018-05-03 14:51:04 -04:00
PKG_CHECK_MODULES(COGL_PANGO_DEP, [$COGL_PANGO_PKG_REQUIRES])
2012-09-16 21:20:10 -04:00
2011-02-09 21:32:11 -05:00
dnl ================================================================
dnl Misc program dependencies.
dnl ================================================================
AC_PROG_INSTALL
dnl ================================================================
dnl GObject-Introspection check
dnl ================================================================
2016-04-11 11:52:46 -04:00
GOBJECT_INTROSPECTION_CHECK([gi_req_version])
2011-02-09 21:32:11 -05:00
dnl ================================================================
dnl Checks for header files.
dnl ================================================================
AC_PATH_X
AC_HEADER_STDC
2011-03-10 10:15:08 -05:00
AC_CHECK_HEADERS(fcntl.h limits.h unistd.h)
2011-02-09 21:32:11 -05:00
dnl ================================================================
dnl Checks for library functions.
dnl ================================================================
2011-05-06 12:21:30 -04:00
dnl The 'ffs' function is part of C99 so it isn't always
dnl available. Cogl has a fallback if needed.
2016-01-12 16:35:51 -05:00
AC_CHECK_FUNCS([ffs])
2011-02-09 21:32:11 -05:00
2012-08-07 06:45:29 -04:00
dnl 'memmem' is a GNU extension but we have a simple fallback
AC_CHECK_FUNCS([memmem])
2013-04-05 13:08:29 -04:00
dnl This is used in the cogl-gles2-gears example but it is a GNU extension
save_libs="$LIBS"
LIBS="$LIBS $LIBM"
AC_CHECK_FUNCS([sincos])
LIBS="$save_libs"
2011-12-16 12:49:28 -05:00
dnl ================================================================
dnl Platform values
dnl ================================================================
dnl These are values from system headers that we want to copy into the
dnl public Cogl headers without having to include the system header
2013-04-27 21:42:24 -04:00
have_poll_h=no
2016-01-12 16:35:51 -05:00
AC_CHECK_HEADER(poll.h,
[
AC_COMPUTE_INT(COGL_SYSDEF_POLLIN, POLLIN, [#include <poll.h>],
AC_MSG_ERROR([Unable to get value of POLLIN]))
AC_COMPUTE_INT(COGL_SYSDEF_POLLPRI, POLLPRI, [#include <poll.h>],
AC_MSG_ERROR([Unable to get value of POLLPRI]))
AC_COMPUTE_INT(COGL_SYSDEF_POLLOUT, POLLOUT, [#include <poll.h>],
AC_MSG_ERROR([Unable to get value of POLLOUT]))
AC_COMPUTE_INT(COGL_SYSDEF_POLLERR, POLLERR, [#include <poll.h>],
AC_MSG_ERROR([Unable to get value of POLLERR]))
AC_COMPUTE_INT(COGL_SYSDEF_POLLHUP, POLLHUP, [#include <poll.h>],
AC_MSG_ERROR([Unable to get value of POLLHUP]))
AC_COMPUTE_INT(COGL_SYSDEF_POLLNVAL, POLLNVAL, [#include <poll.h>],
AC_MSG_ERROR([Unable to get value of POLLNVAL]))
COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_POLL_SUPPORT"
have_poll_h=yes
])
2013-04-27 21:42:24 -04:00
AS_IF([test "x$have_poll_h" = "xno"],
[
COGL_SYSDEF_POLLIN=1
COGL_SYSDEF_POLLPRI=2
COGL_SYSDEF_POLLOUT=4
COGL_SYSDEF_POLLERR=8
COGL_SYSDEF_POLLHUP=16
COGL_SYSDEF_POLLNVAL=32
])
2011-12-16 12:49:28 -05:00
COGL_DEFINES_EXTRA="$COGL_DEFINES_EXTRA
#define COGL_SYSDEF_POLLIN $COGL_SYSDEF_POLLIN
#define COGL_SYSDEF_POLLPRI $COGL_SYSDEF_POLLPRI
#define COGL_SYSDEF_POLLOUT $COGL_SYSDEF_POLLOUT
#define COGL_SYSDEF_POLLERR $COGL_SYSDEF_POLLERR
#define COGL_SYSDEF_POLLHUP $COGL_SYSDEF_POLLHUP
#define COGL_SYSDEF_POLLNVAL $COGL_SYSDEF_POLLNVAL
"
2011-03-10 10:15:08 -05:00
dnl ================================================================
dnl What needs to be substituted in other files
dnl ================================================================
2011-12-16 12:49:28 -05:00
COGL_DEFINES="$COGL_DEFINES_EXTRA"
2011-02-09 21:32:11 -05:00
for x in $COGL_DEFINES_SYMBOLS; do
COGL_DEFINES="$COGL_DEFINES
#define $x 1"
done;
AC_SUBST(COGL_DEFINES)
2012-12-28 21:51:34 -05:00
AM_SUBST_NOTMAKE(COGL_DEFINES)
2011-03-10 10:15:08 -05:00
AS_IF([test "x$cogl_gl_headers" = "x"],
[AC_MSG_ERROR([Internal error: no GL header set])])
dnl cogl_gl_headers is a space separate list of headers to
dnl include. We'll now convert them to a single variable with a
dnl #include line for each header
COGL_GL_HEADER_INCLUDES=""
for x in $cogl_gl_headers; do
COGL_GL_HEADER_INCLUDES="$COGL_GL_HEADER_INCLUDES
#include <$x>"
done;
2011-02-09 21:32:11 -05:00
AC_SUBST(COGL_GL_HEADER_INCLUDES)
2012-12-28 21:51:34 -05:00
AM_SUBST_NOTMAKE(COGL_GL_HEADER_INCLUDES)
2011-02-09 21:32:11 -05:00
AC_SUBST(COGL_DEP_CFLAGS)
AC_SUBST(COGL_DEP_LIBS)
2011-08-02 09:14:06 -04:00
AC_SUBST(COGL_PANGO_DEP_CFLAGS)
AC_SUBST(COGL_PANGO_DEP_LIBS)
2013-02-22 09:56:05 -05:00
AC_SUBST(COGL_GST_DEP_CFLAGS)
AC_SUBST(COGL_GST_DEP_LIBS)
2011-02-09 21:32:11 -05:00
AC_SUBST(COGL_EXTRA_CFLAGS)
AC_SUBST(COGL_EXTRA_LDFLAGS)
2011-04-19 12:47:57 -04:00
# just for compatability with the clutter build...
MAINTAINER_CFLAGS=
AC_SUBST(MAINTAINER_CFLAGS)
2011-02-09 21:32:11 -05:00
AC_OUTPUT(
Makefile
2013-05-30 08:22:22 -04:00
test-fixtures/Makefile
2011-02-09 21:32:11 -05:00
cogl/Makefile
2016-11-25 11:16:07 -05:00
cogl/mutter-cogl-$LIBMUTTER_API_VERSION.pc:cogl/mutter-cogl.pc.in
2011-02-09 21:32:11 -05:00
cogl/cogl-defines.h
2012-03-23 14:05:46 -04:00
cogl/cogl-gl-header.h
2012-07-10 09:14:07 -04:00
cogl/cogl-egl-defines.h
2011-05-05 17:04:07 -04:00
cogl-pango/Makefile
2016-11-25 11:16:07 -05:00
cogl-pango/mutter-cogl-pango-$LIBMUTTER_API_VERSION.pc:cogl-pango/mutter-cogl-pango.pc.in
2013-04-27 22:22:24 -04:00
cogl-path/Makefile
2016-11-25 11:16:07 -05:00
cogl-path/mutter-cogl-path-$LIBMUTTER_API_VERSION.pc:cogl-path/mutter-cogl-path.pc.in
2012-03-23 21:41:48 -04:00
cogl-gles2/Makefile
2016-11-25 11:16:07 -05:00
cogl-gles2/mutter-cogl-gles2-$LIBMUTTER_API_VERSION.pc:cogl-gles2/mutter-cogl-gles2.pc.in
2011-05-05 18:34:38 -04:00
tests/Makefile
2013-05-30 08:22:22 -04:00
tests/config.env
2011-05-05 18:34:38 -04:00
tests/conform/Makefile
2013-05-30 08:22:22 -04:00
tests/unit/Makefile
2012-03-21 18:15:35 -04:00
tests/micro-perf/Makefile
2011-05-05 18:34:38 -04:00
tests/data/Makefile
2011-02-09 21:32:11 -05:00
)
dnl ================================================================
dnl Dah Da!
dnl ================================================================
echo ""
echo "Cogl - $COGL_1_VERSION/$COGL_VERSION (${COGL_RELEASE_STATUS})"
# Global flags
echo ""
echo " • Global:"
echo " Prefix: ${prefix}"
2012-06-20 03:47:41 -04:00
if test "x$COGL_DEFAULT_DRIVER" != "x"; then
echo " Default driver: ${COGL_DEFAULT_DRIVER}"
fi
2011-02-09 21:32:11 -05:00
2011-03-10 10:15:08 -05:00
echo ""
# Features
echo " • Features:"
2011-07-07 15:44:56 -04:00
echo " Drivers: ${enabled_drivers}"
2016-04-10 13:23:50 -04:00
for driver in $enabled_drivers; do
driver=`echo $driver | tr "[gles]" "[GLES]"`
libname=`eval echo \\$COGL_${driver}_LIBNAME`
echo " Library name for $driver: $libname"
done
2011-03-10 10:15:08 -05:00
echo " GL Window System APIs:${GL_WINSYS_APIS}"
if test "x$SUPPORT_EGL" = "xyes"; then
echo " EGL Platforms:${EGL_PLATFORMS}"
2011-05-24 20:37:56 -04:00
echo " Wayland compositor support: ${enable_wayland_egl_server}"
2011-03-10 10:15:08 -05:00
fi
2012-09-17 16:38:29 -04:00
echo " Build libcogl-gles2 GLES 2.0 frontend api: ${enable_cogl_gles2}"
2011-03-10 10:15:08 -05:00
echo " Image backend: ${COGL_IMAGE_BACKEND}"
2011-02-09 21:32:11 -05:00
# Compiler/Debug related flags
echo ""
2013-04-27 22:22:24 -04:00
echo " • Build options:"
echo " Debugging: ${enable_debug}"
echo " Profiling: ${enable_profile}"
2011-09-27 05:27:19 -04:00
echo " Enable deprecated symbols: ${enable_deprecated}"
2011-02-09 21:32:11 -05:00
echo " Compiler flags: ${CFLAGS} ${COGL_EXTRA_CFLAGS}"
2011-03-10 10:15:08 -05:00
echo " Linker flags: ${LDFLAGS} ${COGL_EXTRA_LDFLAGS}"
2011-02-09 21:32:11 -05:00
# Miscellaneous
echo ""
echo " • Extra:"
echo " Build introspection data: ${enable_introspection}"
2013-05-30 08:22:22 -04:00
echo " Build unit tests: ${enable_unit_tests}"
2011-02-09 21:32:11 -05:00
echo ""