Added gst-plugins-base-subtitles0.10-0.10.34 for Meego Harmattan 1.2
[mafwsubrenderer] / gst-plugins-base-subtitles0.10 / common / m4 / gst-glib2.m4
1 dnl check for a minimum version of GLib
2
3 dnl AG_GST_GLIB_CHECK([minimum-version-required])
4
5 AC_DEFUN([AG_GST_GLIB_CHECK],
6 [
7   AC_REQUIRE([AS_NANO])
8
9   dnl Minimum required version of GLib
10   GLIB_REQ=[$1]
11   if test "x$GLIB_REQ" = "x"
12   then
13     AC_MSG_ERROR([Please specify a required version for GLib 2.0])
14   fi
15   AC_SUBST(GLIB_REQ)
16
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)
20
21   if test "x$HAVE_GLIB" = "xno"; then
22     AC_MSG_ERROR([This package requires GLib >= $GLIB_REQ to compile.])
23   fi
24
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"
29
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"
33   fi
34
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])
39
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
44     else
45       enable_gobject_cast_checks=no
46     fi
47   fi
48
49   if test "x$enable_gobject_cast_checks" = "xno"; then
50     GLIB_EXTRA_CFLAGS="$GLIB_EXTRA_CFLAGS -DG_DISABLE_CAST_CHECKS"
51   fi
52
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])
57
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
62     else
63       enable_glib_assertions=no
64     fi
65   fi
66
67   if test "x$enable_glib_assertions" = "xno"; then
68     GLIB_EXTRA_CFLAGS="$GLIB_EXTRA_CFLAGS -DG_DISABLE_ASSERT"
69   fi
70
71   dnl for the poor souls who for example have glib in /usr/local
72   AS_SCRUB_INCLUDE(GLIB_CFLAGS)
73 ])