/pidgin/main: 34ff4ee99c48: Show libgadu version in build dialog

Tomasz Wasilczyk twasilczyk at pidgin.im
Sat Jan 4 19:55:34 EST 2014


Changeset: 34ff4ee99c484ef4c4b22847e91c1215d7b0f093
Author:	 Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date:	 2014-01-05 01:55 +0100
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/34ff4ee99c48

Description:

Show libgadu version in build dialog

diffstat:

 configure.ac        |  12 ++++++++++++
 pidgin/Makefile.am  |   7 ++-----
 pidgin/gtkdialogs.c |  12 +++++++-----
 3 files changed, 21 insertions(+), 10 deletions(-)

diffs (101 lines):

diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -1178,6 +1178,7 @@ fi
 dnl #######################################################################
 dnl # Check for Gadu-Gadu client includes and libraries
 dnl #######################################################################
+dnl TODO: we should get rid of manually entered dirs at some point
 AC_ARG_WITH(gadu-includes, [AS_HELP_STRING([--with-gadu-includes=DIR], [compile the Gadu-Gadu plugin against includes in DIR])], [ac_gadu_includes="$withval"], [ac_gadu_includes="no"])
 AC_ARG_WITH(gadu-libs, [AS_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=""
@@ -1210,6 +1211,8 @@ else
 	GADU_LIBS="$GADU_LIBS -lgadu"
 	AC_CHECK_LIB(gadu, gg_libgadu_version, [gadu_libs=yes], , $GADU_LIBS)
 fi
+
+dnl TODO: it shouldn't be necessary with 1.12.0 and newer
 GADU_CFLAGS=`echo $GADU_CFLAGS |$sedpath 's/-Wall//'`
 
 if test "x$gadu_libs" = "xyes"; then
@@ -1240,6 +1243,7 @@ if test "x$gadu_libs" = "xyes"; then
 	CPPFLAGS="$CPPFLAGS_save"
 fi
 
+dnl TODO: this one shouldn't be necessary too
 if test "x$gadu_libs" = "xyes" -a "x$gadu_manual_check" = "xyes"; then
 	AC_MSG_CHECKING(for supplied libgadu compatibility)
 	CPPFLAGS_save="$CPPFLAGS"
@@ -1271,6 +1275,14 @@ 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" = "xyes"; then
+	AC_DEFINE(HAVE_LIBGADU, 1, [Linked with libgadu])
+fi
+
+if test "x$gadu_libs" != "xyes"; then
+	AC_DEFINE(USE_INTERNAL_LIBGADU, 1, [Using internal libgadu])
+fi
+
 if test "x$gadu_libs" = "x"; then
 	gadu_libs=no
 fi
diff --git a/pidgin/Makefile.am b/pidgin/Makefile.am
--- a/pidgin/Makefile.am
+++ b/pidgin/Makefile.am
@@ -181,12 +181,9 @@ pidgin_LDADD = \
 	$(WEBKIT_LIBS) \
 	$(GTK_LIBS) \
 	$(X11_LIBS) \
+	$(GADU_LIBS) \
 	$(top_builddir)/libpurple/libpurple.la
 
-if USE_INTERNAL_LIBGADU
-INTGG_CFLAGS = -DUSE_INTERNAL_LIBGADU
-endif
-
 AM_CPPFLAGS = \
 	-DDATADIR=\"$(datadir)\" \
 	-DLIBDIR=\"$(libdir)/pidgin/\" \
@@ -208,6 +205,6 @@ AM_CPPFLAGS = \
 	$(GTKSPELL_CFLAGS) \
 	$(LIBXML_CFLAGS) \
 	$(WEBKIT_CFLAGS) \
-	$(INTGG_CFLAGS)
+	$(GADU_CFLAGS)
 endif  # ENABLE_GTK
 
diff --git a/pidgin/gtkdialogs.c b/pidgin/gtkdialogs.c
--- a/pidgin/gtkdialogs.c
+++ b/pidgin/gtkdialogs.c
@@ -48,6 +48,10 @@
 #include <gst/gst.h>
 #endif
 
+#ifdef HAVE_LIBGADU
+#include <libgadu.h>
+#endif
+
 #include "gtk3compat.h"
 
 static GList *dialogwindows = NULL;
@@ -639,15 +643,13 @@ void pidgin_dialogs_buildinfo(void)
 #endif
 #endif
 
-#if defined(_WIN32) || defined(USE_INTERNAL_LIBGADU)
+#if defined(USE_INTERNAL_LIBGADU)
 	g_string_append(str, "<dt>Gadu-Gadu library (libgadu):</dt><dd>Internal</dd>");
-#else
-#ifdef HAVE_LIBGADU
-	g_string_append(str, "<dt>Gadu-Gadu library (libgadu):</dt><dd>Enabled</dd>");
+#elif defined(HAVE_LIBGADU)
+	g_string_append_printf(str, "<dt>Gadu-Gadu library (libgadu):</dt><dd>%s</dd>", gg_libgadu_version());
 #else
 	g_string_append(str, "<dt>Gadu-Gadu library (libgadu):</dt><dd>Disabled</dd>");
 #endif
-#endif
 
 #ifdef USE_GTKSPELL
 	g_string_append(str, "<dt>GtkSpell:</dt><dd>Enabled</dd>");



More information about the Commits mailing list