"Fossies" - the Fresh Open Source Software Archive

Member "gstreamer-1.16.1/common/m4/gst-glib2.m4" (19 Apr 2019, 4282 Bytes) of package /linux/misc/gstreamer-1.16.1.tar.xz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    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 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 development versions
   31   if test "x`expr $PACKAGE_VERSION_MINOR % 2`" = "x1" -a "x`expr $PACKAGE_VERSION_MICRO '<' 90`" = "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]),[enable_gobject_cast_checks=$enableval],
   38     [enable_gobject_cast_checks=auto])
   39 
   40   if test "x$enable_gobject_cast_checks" = "xauto"; then
   41     dnl Turn on cast checks only for development versions
   42     if test "x`expr $PACKAGE_VERSION_MINOR % 2`" = "x1" -a "x`expr $PACKAGE_VERSION_MICRO '<' 90`" = "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/yes@:>@]],
   55       [Enable GLib assertion]),[enable_glib_assertions=$enableval],
   56     [enable_glib_assertions=yes])
   57 
   58   if test "x$enable_glib_assertions" = "xno"; then
   59     GLIB_EXTRA_CFLAGS="$GLIB_EXTRA_CFLAGS -DG_DISABLE_ASSERT"
   60   fi
   61 
   62   dnl Find location of glib utils. People may want to or have to override these,
   63   dnl e.g. in a cross-compile situation where PATH is a bit messed up. We need
   64   dnl for these tools to work on the host, so can't just use the one from the
   65   dnl GLib installation that pkg-config picks up, as that might be for a
   66   dnl different target architecture.
   67   dnl
   68   dnl glib-genmarshal:
   69   AC_MSG_CHECKING(for glib-genmarshal)
   70   if test "x$GLIB_GENMARSHAL" != "x"; then
   71     AC_MSG_RESULT([$GLIB_GENMARSHAL (from environment)])
   72   else
   73     GLIB_GENMARSHAL=`$PKG_CONFIG --variable=glib_genmarshal glib-2.0`
   74     if $GLIB_GENMARSHAL --version 2>/dev/null >/dev/null; then
   75       AC_MSG_RESULT([$GLIB_GENMARSHAL (from pkg-config path)])
   76     else
   77       AC_PATH_PROG(GLIB_GENMARSHAL, [glib-genmarshal], [glib-genmarshal])
   78       AC_MSG_RESULT([$GLIB_GENMARSHAL])
   79     fi
   80   fi
   81   if ! $GLIB_GENMARSHAL --version 2>/dev/null >/dev/null; then
   82     AC_MSG_WARN([$GLIB_GENMARSHAL does not seem to work!])
   83   fi
   84   AC_SUBST(GLIB_GENMARSHAL)
   85 
   86   dnl glib-mkenums:
   87   AC_MSG_CHECKING(for glib-mkenums)
   88   if test "x$GLIB_MKENUMS" != "x"; then
   89     AC_MSG_RESULT([$GLIB_MKENUMS (from environment)])
   90   else
   91     dnl glib-mkenums is written in perl so should always work really
   92     GLIB_MKENUMS=`$PKG_CONFIG --variable=glib_mkenums glib-2.0`
   93     AC_MSG_RESULT([$GLIB_MKENUMS])
   94   fi
   95   if ! $GLIB_MKENUMS --version 2>/dev/null >/dev/null; then
   96     AC_MSG_WARN([$GLIB_MKENUMS does not seem to work!])
   97   fi
   98   AC_SUBST(GLIB_MKENUMS)
   99 
  100   AC_SUBST(GLIB_EXTRA_CFLAGS)
  101 
  102   dnl Now check for GIO
  103   PKG_CHECK_MODULES(GIO, gio-2.0 >= $GLIB_REQ)
  104   if test "x$HAVE_GIO" = "xno"; then
  105     AC_MSG_ERROR([This package requires GIO >= $GLIB_REQ to compile.])
  106   fi
  107   
  108   GIO_MODULE_DIR="`$PKG_CONFIG --variable=giomoduledir gio-2.0`"
  109   AC_DEFINE_UNQUOTED(GIO_MODULE_DIR, "$GIO_MODULE_DIR",
  110       [The GIO modules directory.])
  111   GIO_LIBDIR="`$PKG_CONFIG --variable=libdir gio-2.0`"
  112   AC_DEFINE_UNQUOTED(GIO_LIBDIR, "$GIO_LIBDIR",
  113       [The GIO library directory.])
  114   GIO_PREFIX="`$PKG_CONFIG --variable=prefix gio-2.0`"
  115   AC_DEFINE_UNQUOTED(GIO_PREFIX, "$GIO_PREFIX",
  116       [The GIO install prefix.])
  117 
  118   AC_SUBST(GIO_CFLAGS)
  119   AC_SUBST(GIO_LIBS)
  120   AC_SUBST(GIO_LDFLAGS)
  121 ])