[frogr] Use libsoup-gnome instead of plain libsoup when available.



commit d8eab57a35e1f659f19cf06acc03ae25e916b0c8
Author: Mario Sanchez Prada <msanchez igalia com>
Date:   Fri May 27 17:31:14 2011 +0200

    Use libsoup-gnome instead of plain libsoup when available.
    
    For the MacOSX platform plain libsoup will be always used anyway,
    since it's not the mainly supported platform but an additional one,
    and the main interest of using libsoup-gnome is precisely to better
    integrate frogr with the GNOME platform.
    
    Also, for cases when even in the GNOME platform one could prefer not
    to use libsoup-gnome, even if available, a new parameter was added to
    the configure script to specify that (--with-libsoup=plain|gnome).

 configure.ac                |   53 ++++++++++++++++++++++++++++++++++++------
 src/flicksoup/fsp-session.c |    6 +++++
 2 files changed, 51 insertions(+), 8 deletions(-)
---
diff --git a/configure.ac b/configure.ac
index 5d11a69..b5e0427 100644
--- a/configure.ac
+++ b/configure.ac
@@ -29,11 +29,6 @@ PKG_CHECK_MODULES(EXIF, libexif >= $EXIF_MIN_VERSION)
 FROGR_CFLAGS="$FROGR_CFLAGS $EXIF_CFLAGS"
 FROGR_LIBS="$FROGR_LIBS $EXIF_LIBS"
 
-LIBSOUP_MIN_VERSION=2.24
-PKG_CHECK_MODULES(LIBSOUP, libsoup-2.4 >= $LIBSOUP_MIN_VERSION)
-FROGR_CFLAGS="$FROGR_CFLAGS $LIBSOUP_CFLAGS"
-FROGR_LIBS="$FROGR_LIBS $LIBSOUP_LIBS"
-
 LIBXML2_MIN_VERSION=2.6.8
 PKG_CHECK_MODULES(LIBXML2, libxml-2.0 >= $LIBXML2_MIN_VERSION)
 FROGR_CFLAGS="$FROGR_CFLAGS $LIBXML2_CFLAGS"
@@ -60,6 +55,47 @@ fi
 
 AM_CONDITIONAL([HAVE_MAC_INTEGRATION],[test "x$platform" = "xmacosx"])
 
+# Decide whether to use libsoup or libsoup-gnome (if available)
+
+LIBSOUP_MIN_VERSION=2.24
+
+if test "x$platform" = "xgnome"; then
+   # For the GNOME platform allow using libsoup-gnome, if available
+   AC_ARG_WITH([libsoup],
+           [AS_HELP_STRING([--with-libsoup=plain|gnome], [libsoup variant to use (default: gnome)])],
+           [case "$with_libsoup" in
+           plain|gnome) ;;
+           *) AC_MSG_ERROR([Wrong libsoup variant]) ;;
+           esac],
+           [with_libsoup=gnome])
+else
+   # Other non-GNOME platforms (e.g. MacOSX) to support plain libsoup only
+   with_libsoup=plain
+fi
+
+if test "x$with_libsoup" = "xgnome"; then
+   AC_MSG_CHECKING([libsoup variant to use])
+   PKG_CHECK_MODULES(LIBSOUP_GNOME,
+                     [libsoup-gnome-2.4 >= $LIBSOUP_MIN_VERSION],
+                     [have_libsoup_gnome="yes"], [have_libsoup_gnome="no"])
+
+   if test "x$have_libsoup_gnome" = "xyes"; then
+      LIBSOUP_CFLAGS="$LIBSOUP_GNOME_CFLAGS"
+      LIBSOUP_LIBS="$LIBSOUP_GNOME_LIBS"
+
+      AC_DEFINE(HAVE_LIBSOUP_GNOME, 1, [Have libsoup-gnome])
+      libsoup_variant="libsoup-gnome"
+   fi
+fi
+
+if test "x$libsoup_variant" = "x"; then
+   PKG_CHECK_MODULES(LIBSOUP, [libsoup-2.4 >= $LIBSOUP_MIN_VERSION])
+   libsoup_variant="plain libsoup"
+fi
+
+FROGR_CFLAGS="$FROGR_CFLAGS $LIBSOUP_CFLAGS"
+FROGR_LIBS="$FROGR_LIBS $LIBSOUP_LIBS"
+
 # Select target version of GTK to use
 
 AC_MSG_CHECKING([GTK+ version to use])
@@ -166,9 +202,10 @@ echo "*************************************"
 echo "*** frogr is ready to be compiled ***"
 echo "*************************************"
 echo ""
-echo "Platform           : $platform"
-echo "Using GTK+ version : $with_gtk"
-echo "Enable debug       : $enable_debug"
+echo "Platform              : $platform"
+echo "Using GTK+ version    : $with_gtk"
+echo "Using libsoup variant : $libsoup_variant"
+echo "Enable debug          : $enable_debug"
 echo ""
 echo ""
 echo "Configure successful. Type 'make' to compile"
diff --git a/src/flicksoup/fsp-session.c b/src/flicksoup/fsp-session.c
index 66e4c68..b568b76 100644
--- a/src/flicksoup/fsp-session.c
+++ b/src/flicksoup/fsp-session.c
@@ -31,7 +31,13 @@
 #include "fsp-session.h"
 
 #include <config.h>
+
+#ifdef HAVE_LIBSOUP_GNOME
+#include <libsoup/soup-gnome.h>
+#else
 #include <libsoup/soup.h>
+#endif
+
 #include <stdarg.h>
 #include <string.h>
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]