1 dnl check for a minimum version of GLib
3 dnl AG_GST_GLIB_CHECK([minimum-version-required])
5 AC_DEFUN([AG_GST_GLIB_CHECK],
9 dnl Minimum required version of GLib
11 if test "x$GLIB_REQ" = "x"
13 AC_MSG_ERROR([Please specify a required version for GLib 2.0])
17 dnl Check for glib with everything
18 AG_GST_PKG_CHECK_MODULES(GLIB,
19 glib-2.0 >= $GLIB_REQ gobject-2.0 gthread-2.0 gmodule-no-export-2.0)
21 if test "x$HAVE_GLIB" = "xno"; then
22 AC_MSG_ERROR([This package requires GLib >= $GLIB_REQ to compile.])
25 dnl Add define to tell GLib that threading is always enabled within GStreamer
26 dnl code (optimisation, bypasses checks if the threading system is enabled
27 dnl when using threading primitives)
28 GLIB_EXTRA_CFLAGS="$GLIB_EXTRA_CFLAGS -DG_THREADS_MANDATORY"
30 dnl Define G_DISABLE_DEPRECATED for GIT versions
31 if test "x$PACKAGE_VERSION_NANO" = "x1"; then
32 GLIB_EXTRA_CFLAGS="$GLIB_EXTRA_CFLAGS -DG_DISABLE_DEPRECATED"
35 AC_ARG_ENABLE(gobject-cast-checks,
36 AS_HELP_STRING([--enable-gobject-cast-checks[=@<:@no/auto/yes@:>@]],
37 [Enable GObject cast checks]),,
38 [enable_gobject_cast_checks=auto])
40 if test "x$enable_gobject_cast_checks" = "xauto"; then
41 dnl For releases, turn off the cast checks
42 if test "x$PACKAGE_VERSION_NANO" = "x1"; then
43 enable_gobject_cast_checks=yes
45 enable_gobject_cast_checks=no
49 if test "x$enable_gobject_cast_checks" = "xno"; then
50 GLIB_EXTRA_CFLAGS="$GLIB_EXTRA_CFLAGS -DG_DISABLE_CAST_CHECKS"
53 AC_ARG_ENABLE(glib-asserts,
54 AS_HELP_STRING([--enable-glib-asserts[=@<:@no/auto/yes@:>@]],
55 [Enable GLib assertion]),,
56 [enable_glib_assertions=auto])
58 if test "x$enable_glib_assertions" = "xauto"; then
59 dnl For releases, turn off the assertions
60 if test "x$PACKAGE_VERSION_NANO" = "x1"; then
61 enable_glib_assertions=yes
63 enable_glib_assertions=no
67 if test "x$enable_glib_assertions" = "xno"; then
68 GLIB_EXTRA_CFLAGS="$GLIB_EXTRA_CFLAGS -DG_DISABLE_ASSERT"
71 dnl for the poor souls who for example have glib in /usr/local
72 AS_SCRUB_INCLUDE(GLIB_CFLAGS)
74 AC_SUBST(GLIB_EXTRA_CFLAGS)