From a99508a7bbdcb858af1da8dcb7fca2beba243ba7 Mon Sep 17 00:00:00 2001 From: Pierre-Luc Beaudoin Date: Thu, 23 Apr 2009 23:19:39 -0400 Subject: [PATCH] Finish the fix to bug 573037: Support proxies By linking against libsoup-gnome (and enabling its features), libchamplain will gain autodetection of proxies. --- champlain/Makefile.am | 3 ++- champlain/champlain-network-map-source.c | 10 +++++++++- configure.ac | 18 +++++++++++++++++- 3 files changed, 28 insertions(+), 3 deletions(-) diff --git a/champlain/Makefile.am b/champlain/Makefile.am index 9a6f139..40bdb32 100644 --- a/champlain/Makefile.am +++ b/champlain/Makefile.am @@ -72,7 +72,7 @@ libchamplain_include_HEADERS = \ champlain-marker.h \ champlain-version.h -libchamplain_0_3_la_LIBADD = $(DEPS_LIBS) ../tidy/libtidy-1.0.la +libchamplain_0_3_la_LIBADD = $(DEPS_LIBS) $(SOUP_LIBS) ../tidy/libtidy-1.0.la libchamplain_includedir = $(includedir)/libchamplain-0.3/champlain @@ -82,6 +82,7 @@ libchamplain_0_3_la_LDFLAGS = -version-info $(LIBRARY_VERSION) \ AM_CPPFLAGS = \ $(DEPS_CFLAGS) \ + $(SOUP_CFLAGS) \ -DDATADIR=\""$(datadir)"\" \ -I$(top_srcdir)/tidy \ -I$(top_srcdir) \ diff --git a/champlain/champlain-network-map-source.c b/champlain/champlain-network-map-source.c index 4477288..8b998ca 100644 --- a/champlain/champlain-network-map-source.c +++ b/champlain/champlain-network-map-source.c @@ -37,7 +37,11 @@ #include #include #include +#ifdef HAVE_LIBSOUP_GNOME +#include +#else #include +#endif #include #include #include @@ -574,7 +578,11 @@ champlain_network_map_source_get_tile (ChamplainMapSource *map_source, if (!soup_session) soup_session = soup_session_async_new_with_options ("proxy-uri", - soup_uri_new (priv->proxy_uri), NULL); + soup_uri_new (priv->proxy_uri), +#ifdef HAVE_LIBSOUP_GNOME + SOUP_SESSION_ADD_FEATURE_BY_TYPE, SOUP_TYPE_PROXY_RESOLVER_GNOME, +#endif + NULL); uri = champlain_network_map_source_get_tile_uri (network_map_source, champlain_tile_get_x (tile), champlain_tile_get_y (tile), diff --git a/configure.ac b/configure.ac index 2866678..243595a 100644 --- a/configure.ac +++ b/configure.ac @@ -52,7 +52,6 @@ PKG_CHECK_MODULES(DEPS, clutter-0.8 >= 0.8.4, clutter-cairo-0.8 >= 0.8, cairo >= 1.4, - libsoup-2.4 >= 2.4.1, gio-2.0 >= 2.16 ] ) @@ -60,6 +59,22 @@ PKG_CHECK_MODULES(DEPS, GTK_DOC_CHECK(1.9) IDT_COMPILE_WARNINGS +# ----------------------------------------------------------- +# Check for libsoup, use libsoup-gnome if available +# ----------------------------------------------------------- +PKG_CHECK_MODULES(SOUP, libsoup-gnome-2.4 >= 2.27, [ + have_soup_gnome="yes", + AC_DEFINE(HAVE_LIBSOUP_GNOME,1,[libsoup gnome integration]) + ], have_soup_gnome="no") + +if test "x$have_soup_gnome" = "xno"; then + PKG_CHECK_MODULES(SOUP, libsoup-2.4 >= 2.4.1, + have_soup="yes", have_soup="no") +fi + +AC_SUBST(SOUP_CFLAGS) +AC_SUBST(SOUP_LIBS) + # ----------------------------------------------------------- # Enable debug # ----------------------------------------------------------- @@ -210,6 +225,7 @@ echo " Prefix: ${prefix}" echo " Compiler flags: ${CPPFLAGS}" echo " Documentation: ${enable_gtk_doc}" echo " Debug: ${enable_debug}" +echo " libsoup-gnome: ${have_soup_gnome}" echo " Gtk+ View: ${enable_gtk}" echo "" echo "Bindings:" -- 2.39.5