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