/soc/2012/tomkiewicz/gg: c671ae84307f: Updated libgadu to 1.11.2...

Tomasz Wasilczyk tomkiewicz at cpw.pidgin.im
Thu Jul 5 13:31:51 EDT 2012


Changeset: c671ae84307f5aedcce908a2bd4dc6f5056ddb57
Author:	 Tomasz Wasilczyk <tomkiewicz at cpw.pidgin.im>
Date:	 2012-06-27 14:55 +0200
Branch:	 soc.2012.gg
URL: http://hg.pidgin.im/soc/2012/tomkiewicz/gg/rev/c671ae84307f

Description:

Updated libgadu to 1.11.2, configure.ac refactoring

diffstat:

 configure.ac                          |  56 ++++++++++++++++++++--------------
 libpurple/protocols/gg/Makefile.am    |   4 +-
 libpurple/protocols/gg/lib/config.h   |   4 +-
 libpurple/protocols/gg/lib/resolver.c |   7 +--
 libpurple/protocols/gg/utils.h        |   6 +-
 5 files changed, 45 insertions(+), 32 deletions(-)

diffs (172 lines):

diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -1018,13 +1018,14 @@
 AC_ARG_WITH(gadu-libs, [AC_HELP_STRING([--with-gadu-libs=DIR], [compile the Gadu-Gadu plugin against the libs in DIR])], [ac_gadu_libs="$withval"], [ac_gadu_libs="no"])
 GADU_CFLAGS=""
 GADU_LIBS=""
+GADU_LIBGADU_VERSION=1.11.2
 if test -n "$with_gadu_includes" || test -n "$with_gadu_libs"; then
 	gadu_manual_check="yes"
 else
 	gadu_manual_check="no"
 fi
 if test "x$gadu_manual_check" = "xno"; then
-	PKG_CHECK_MODULES(GADU, [libgadu >= 1.11.1], [
+	PKG_CHECK_MODULES(GADU, [libgadu >= $GADU_LIBGADU_VERSION], [
 		gadu_includes="yes"
 		gadu_libs="yes"
 	], [
@@ -1056,28 +1057,7 @@
 #error "libgadu is not compatible with the GPL when compiled with OpenSSL support."
 #endif
 	]])], [
-		AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <libgadu.h>]], [[
-#if GG_DEFAULT_PROTOCOL_VERSION < 0x2e
-#error "Your libgadu version is too old. libpurple requires 1.11.1 or higher."
-#endif
-		]])], [
-			AC_MSG_RESULT(yes)
-			AC_DEFINE([HAVE_LIBGADU], [1],
-				[Define to 1 if you have libgadu.])
-		], [
-			AC_MSG_RESULT(no)
-			echo
-			echo
-			echo "Your supplied copy of libgadu is too old."
-			echo "Install version 1.11.1 or newer."
-			echo "Then rerun this ./configure"
-			echo
-			echo "Falling back to using our own copy of libgadu"
-			echo
-			GADU_LIBS=""
-			GADU_CFLAGS=""
-			gadu_libs=no
-		])
+		AC_MSG_RESULT(yes)
 	], [
 		AC_MSG_RESULT(no)
 		echo
@@ -1096,6 +1076,35 @@
 	CPPFLAGS="$CPPFLAGS_save"
 fi
 
+if test "x$gadu_libs" = "xyes" -a "x$gadu_manual_check" = "xyes"; then
+	AC_MSG_CHECKING(for supplied libgadu compatibility)
+	CPPFLAGS_save="$CPPFLAGS"
+	CPPFLAGS="$CPPFLAGS $GADU_CFLAGS"
+
+	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include <libgadu.h>]], [[
+#if GG_DEFAULT_PROTOCOL_VERSION < 0x2e
+#error "Your libgadu version is too old."
+#endif
+	]])], [
+		AC_MSG_RESULT(yes)
+	], [
+		AC_MSG_RESULT(no)
+		echo
+		echo "Your supplied copy of libgadu is too old."
+		echo "Install version $GADU_LIBGADU_VERSION or newer."
+		echo "Then rerun this ./configure"
+		echo
+		echo "Falling back to using our own copy of libgadu"
+		echo
+		GADU_LIBS=""
+		GADU_CFLAGS=""
+		gadu_libs=no
+	])
+
+	CPPFLAGS="$CPPFLAGS_save"
+fi
+
+AM_CONDITIONAL(HAVE_LIBGADU, test "x$gadu_libs" = "xyes")
 AM_CONDITIONAL(USE_INTERNAL_LIBGADU, test "x$gadu_libs" != "xyes")
 
 if test "x$gadu_libs" = "x"; then
@@ -1104,6 +1113,7 @@
 
 AC_SUBST(GADU_LIBS)
 AC_SUBST(GADU_CFLAGS)
+AC_SUBST(GADU_LIBGADU_VERSION)
 
 AC_ARG_ENABLE(distrib,,,enable_distrib=no)
 AM_CONDITIONAL(DISTRIB, test "x$enable_distrib" = "xyes")
diff --git a/libpurple/protocols/gg/Makefile.am b/libpurple/protocols/gg/Makefile.am
--- a/libpurple/protocols/gg/Makefile.am
+++ b/libpurple/protocols/gg/Makefile.am
@@ -34,7 +34,9 @@
 	lib/session.h \
 	lib/sha1.c
 
-INTGG_CFLAGS = -I$(top_srcdir)/libpurple/protocols/gg/lib -DGG_IGNORE_DEPRECATED
+INTGG_CFLAGS = -I$(top_srcdir)/libpurple/protocols/gg/lib \
+	-DGG_IGNORE_DEPRECATED \
+	-DGG_INTERNAL_LIBGADU_VERSION=$(GADU_LIBGADU_VERSION)
 endif
 
 if USE_GNUTLS
diff --git a/libpurple/protocols/gg/lib/config.h b/libpurple/protocols/gg/lib/config.h
--- a/libpurple/protocols/gg/lib/config.h
+++ b/libpurple/protocols/gg/lib/config.h
@@ -3,7 +3,9 @@
 /* libpurple's config */
 #include <config.h>
 
-#define GG_LIBGADU_VERSION "1.11.1"
+#define GGP_QUOTE(x) GGP_QUOTE2(x)
+#define GGP_QUOTE2(x) #x
+#define GG_LIBGADU_VERSION GGP_QUOTE(GG_INTERNAL_LIBGADU_VERSION)
 
 /* Defined if libgadu was compiled for bigendian machine. */
 #undef GG_CONFIG_BIGENDIAN
diff --git a/libpurple/protocols/gg/lib/resolver.c b/libpurple/protocols/gg/lib/resolver.c
--- a/libpurple/protocols/gg/lib/resolver.c
+++ b/libpurple/protocols/gg/lib/resolver.c
@@ -249,6 +249,9 @@
 /**
  * \internal RozwiÄ
zuje nazwÄ™ i zapisuje wynik do podanego desktyptora.
  *
+ * \note Użycie logowania w tej funkcji może mieć negatywny wpływ na
+ * aplikacje jednowÄ
tkowe korzystajÄ
ce.
+ *
  * \param fd Deskryptor
  * \param hostname Nazwa serwera
  *
@@ -260,8 +263,6 @@
 	int addr_count;
 	int res = 0;
 
-	gg_debug(GG_DEBUG_MISC, "// gg_resolver_run(%d, %s)\n", fd, hostname);
-
 	if ((addr_ip[0].s_addr = inet_addr(hostname)) == INADDR_NONE) {
 		if (gg_gethostbyname_real(hostname, &addr_list, &addr_count, 1) == -1) {
 			addr_list = addr_ip;
@@ -274,8 +275,6 @@
 		addr_count = 1;
 	}
 
-	gg_debug(GG_DEBUG_MISC, "// gg_resolver_run() count = %d\n", addr_count);
-
 	if (write(fd, addr_list, (addr_count + 1) * sizeof(struct in_addr)) != (addr_count + 1) * sizeof(struct in_addr))
 		res = -1;
 
diff --git a/libpurple/protocols/gg/utils.h b/libpurple/protocols/gg/utils.h
--- a/libpurple/protocols/gg/utils.h
+++ b/libpurple/protocols/gg/utils.h
@@ -20,8 +20,8 @@
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02111-1301  USA
  */
 
-#ifndef _PURPLE_GG_UTILS_H
-#define _PURPLE_GG_UTILS_H
+#ifndef _GGP_UTILS_H
+#define _GGP_UTILS_H
 
 #include <internal.h>
 #include <libgadu.h>
@@ -78,4 +78,4 @@
 guint ggp_http_input_add(struct gg_http *http_req, PurpleInputFunction func,
 	gpointer user_data);
 
-#endif /* _PURPLE_GG_UTILS_H */
+#endif /* _GGP_UTILS_H */



More information about the Commits mailing list