[Cogl] [PATCH 1/2] configure: Don't allow --enable-gdk-pixbuf with --disable-glib

Robert Bragg robert at sixbynine.org
Mon Nov 26 09:29:33 PST 2012


This looks good to land to me:

Reviewed-by: Robert Bragg <robert at linux.intel.com>

thanks,
- Robert


On Thu, Nov 22, 2012 at 5:07 PM, Neil Roberts <neil at linux.intel.com> wrote:

> The GDK pixbuf support requires being able to propagate errors from
> GDKPixbuf as GErrors. This won't work if we are using the builtin
> version of GLib because any attempt to call g_error_free from within
> Cogl will use the internal version which will free the error using the
> wrong slice allocator. It probably doesn't make much sense to build
> without glib but with gdk-pixbuf so there's not much point in trying
> to work around this situation.
>
> Previously if you specified --enable-gdk-pixbuf but gdk-pixbuf was not
> available it would silently disable it. This pach also fixes it so
> that it will report an error in that case.
>
> If --enable-gdk-pixbuf is not specified it will now default to
> enabling it only if both glib is enabled and gdk-pixbuf is available.
>
> This patch looks slightly longer than it ought to be because it moves
> the check for glib up to above the descisions about the image backend.
> ---
>  configure.ac | 141
> +++++++++++++++++++++++++++++------------------------------
>  1 file changed, 70 insertions(+), 71 deletions(-)
>
> diff --git a/configure.ac b/configure.ac
> index ced55bf..17d696e 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -360,6 +360,69 @@ AS_CASE([$enable_deprecated],
>  # strip leading spaces
>  COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS ${DEPRECATED_CFLAGS#*  }"
>
> +dnl ================================================================
> +dnl Check for dependency packages.
> +dnl ================================================================
> +
> +dnl     ============================================================
> +dnl     Should glib be used?
> +dnl     ============================================================
> +AM_PATH_GLIB_2_0([glib_req_version],
> +                 [have_glib=yes], [have_glib=no],
> +                 [gobject gthread gmodule-no-export])
> +AC_ARG_ENABLE(
> +  [glib],
> +  [AC_HELP_STRING([--enable-glib=@<:@no/yes@:>@], [Enable glib support
> @<:@default=yes@:>@])],
> +  [],
> +  enable_glib=yes
> +)
> +
> +AS_IF([test "x$have_glib" = "xno" && test "x$enable_glib" = "xyes"],
> +      [AC_MSG_ERROR([gobject-2.0 is required])])
> +
> +AM_CONDITIONAL([USE_GLIB], [test "x$enable_glib" = "xyes"])
> +
> +AS_IF([test "x$enable_glib" = "xyes"],
> +      [
> +        COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_GLIB_SUPPORT"
> +        COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS
> COGL_HAS_GTYPE_SUPPORT"
> +        COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES gobject-2.0
> gmodule-no-export-2.0"
> +      ],
> +      [
> +        AS_GLIBCONFIG([deps/glib])
> +        COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS -I\$(top_srcdir)/deps"
> +        COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS -I\$(top_srcdir)/deps/glib"
> +        COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS
> -I\$(top_srcdir)/deps/gmodule"
> +        EXPERIMENTAL_CONFIG=yes
> +        EXPERIMENTAL_OPTIONS="$EXPERIMENTAL_OPTIONS --disable-glib,"
> +        enable_nls=no
> +      ]
> +)
> +
> +dnl     ============================================================
> +dnl     Should cogl-pango be built?
> +dnl     ============================================================
> +
> +AS_IF([test "x$enable_glib" != "xyes"],
> +      [
> +        AS_IF([test "x$enable_cogl_pango" = "xyes"],
> +              AC_MSG_ERROR([--enable-cogl-pango conflicts with
> --disable-glib]))
> +        enable_cogl_pango=no
> +      ]
> +)
> +
> +AC_ARG_ENABLE(
> +  [cogl-pango],
> +  [AC_HELP_STRING([--enable-cogl-pango=@<:@no/yes@:>@], [Enable pango
> support @<:@default=yes@:>@])],
> +  [],
> +  enable_cogl_pango=yes
> +)
> +AS_IF([test "x$enable_cogl_pango" = "xyes"],
> +      [
> +       COGL_PANGO_PKG_REQUIRES="$COGL_PANGO_PKG_REQUIRES pangocairo >=
> pangocairo_req_version"
> +      ]
> +)
> +
>  dnl     ============================================================
>  dnl     Choose image loading backend
>  dnl     ============================================================
> @@ -367,13 +430,11 @@ AC_ARG_ENABLE(
>    [gdk-pixbuf],
>    [AC_HELP_STRING([--enable-gdk-pixbuf=@<:@no/yes@:>@], [Enable image
> loading via gdk-pixbuf @<:@default=yes@:>@])],
>    [],
> -  enable_gdk_pixbuf=yes
> +  [AS_IF([test "x$enable_glib" = "xyes"],
> +         [PKG_CHECK_EXISTS([gdk-pixbuf-2.0 >= gdk_pixbuf_req_version],
> +                           [enable_gdk_pixbuf=yes],
> +                           [enable_gdk_pixbuf=no])])]
>  )
> -if test "x$enable_gdk_pixbuf" = "xyes"; then
> -  PKG_CHECK_EXISTS([gdk-pixbuf-2.0], [have_gdk_pixbuf=yes],
> [have_gdk_pixbuf=no])
> -else
> -  have_gdk_pixbuf=no
> -fi
>
>  AC_ARG_ENABLE(
>    [quartz-image],
> @@ -383,8 +444,10 @@ AC_ARG_ENABLE(
>  )
>
>  AS_IF(
> -  [test "x$have_gdk_pixbuf" = "xyes"],
> +  [test "x$enable_gdk_pixbuf" = "xyes"],
>    [
> +    AS_IF([test "x$enable_glib" != "xyes"],
> +          [AC_MSG_ERROR([--disable-glib conflicts with
> --enable-gdk-pixbuf])])
>      AC_DEFINE([USE_GDKPIXBUF], 1, [Use GdkPixbuf for loading image data])
>      COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES gdk-pixbuf-2.0 >=
> gdk_pixbuf_req_version"
>      COGL_IMAGE_BACKEND="gdk-pixbuf"
> @@ -1011,70 +1074,6 @@ GTK_DOC_CHECK([gtk_doc_req_version], [--flavour
> no-tmpl])
>  AM_CONDITIONAL([BUILD_GTK_DOC], [test "x$enable_gtk_doc" = "xyes"])
>
>  dnl ================================================================
> -dnl Check for dependency packages.
> -dnl ================================================================
> -
> -dnl     ============================================================
> -dnl     Should glib be used?
> -dnl     ============================================================
> -AM_PATH_GLIB_2_0([glib_req_version],
> -                 [have_glib=yes], [have_glib=no],
> -                 [gobject gthread gmodule-no-export])
> -AC_ARG_ENABLE(
> -  [glib],
> -  [AC_HELP_STRING([--enable-glib=@<:@no/yes@:>@], [Enable glib support
> @<:@default=yes@:>@])],
> -  [],
> -  enable_glib=yes
> -)
> -
> -AS_IF([test "x$have_glib" = "xno" && test "x$enable_glib" = "xyes"],
> -      [AC_MSG_ERROR([gobject-2.0 is required])])
> -
> -AM_CONDITIONAL([USE_GLIB], [test "x$enable_glib" = "xyes"])
> -
> -AS_IF([test "x$enable_glib" = "xyes"],
> -      [
> -        COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS COGL_HAS_GLIB_SUPPORT"
> -        COGL_DEFINES_SYMBOLS="$COGL_DEFINES_SYMBOLS
> COGL_HAS_GTYPE_SUPPORT"
> -        COGL_PKG_REQUIRES="$COGL_PKG_REQUIRES gobject-2.0
> gmodule-no-export-2.0"
> -      ],
> -      [
> -        AS_GLIBCONFIG([deps/glib])
> -        COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS -I\$(top_srcdir)/deps"
> -        COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS -I\$(top_srcdir)/deps/glib"
> -        COGL_EXTRA_CFLAGS="$COGL_EXTRA_CFLAGS
> -I\$(top_srcdir)/deps/gmodule"
> -        EXPERIMENTAL_CONFIG=yes
> -        EXPERIMENTAL_OPTIONS="$EXPERIMENTAL_OPTIONS --disable-glib,"
> -        enable_nls=no
> -      ]
> -)
> -
> -dnl     ============================================================
> -dnl     Should cogl-pango be built?
> -dnl     ============================================================
> -
> -AS_IF([test "x$enable_glib" != "xyes"],
> -      [
> -        AS_IF([test "x$enable_cogl_pango" = "xyes"],
> -              AC_MSG_ERROR([--enable-cogl-pango conflicts with
> --disable-glib]))
> -        enable_cogl_pango=no
> -      ]
> -)
> -
> -AC_ARG_ENABLE(
> -  [cogl-pango],
> -  [AC_HELP_STRING([--enable-cogl-pango=@<:@no/yes@:>@], [Enable pango
> support @<:@default=yes@:>@])],
> -  [],
> -  enable_cogl_pango=yes
> -)
> -AS_IF([test "x$enable_cogl_pango" = "xyes"],
> -      [
> -       COGL_PANGO_PKG_REQUIRES="$COGL_PANGO_PKG_REQUIRES pangocairo >=
> pangocairo_req_version"
> -      ]
> -)
> -
> -
> -dnl ================================================================
>  dnl I18n stuff.
>  dnl ================================================================
>  AM_GNU_GETTEXT_VERSION([0.17])
> --
> 1.7.11.3.g3c3efa5
>
> _______________________________________________
> Cogl mailing list
> Cogl at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/cogl
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/cogl/attachments/20121126/9c68978a/attachment.html>


More information about the Cogl mailing list