Merge default branch soc.2013.gobjectification.plugins

Wed, 16 Apr 2014 12:04:51 +0530

author
Ankit Vani <a@nevitus.org>
date
Wed, 16 Apr 2014 12:04:51 +0530
branch
soc.2013.gobjectification.plugins
changeset 37136
cfa7c57f9ca5
parent 37135
6271bcdee576 (current diff)
parent 35857
b7fc060d5c94 (diff)
child 37137
27cf01a05bdf

Merge default branch

configure.ac file | annotate | diff | comparison | revisions
doc/reference/finch/Makefile.am file | annotate | diff | comparison | revisions
doc/reference/libpurple/Makefile.am file | annotate | diff | comparison | revisions
doc/reference/libpurple/plugin_i18n.xml file | annotate | diff | comparison | revisions
doc/reference/pidgin/Makefile.am file | annotate | diff | comparison | revisions
finch/Makefile.am file | annotate | diff | comparison | revisions
finch/libfinch.c file | annotate | diff | comparison | revisions
finch/libgnt/wms/Makefile.am file | annotate | diff | comparison | revisions
finch/plugins/Makefile.am file | annotate | diff | comparison | revisions
libpurple/Makefile.am file | annotate | diff | comparison | revisions
libpurple/core.c file | annotate | diff | comparison | revisions
libpurple/dbus-server.h file | annotate | diff | comparison | revisions
libpurple/example/Makefile.am file | annotate | diff | comparison | revisions
libpurple/example/nullclient.c file | annotate | diff | comparison | revisions
libpurple/plugins.c file | annotate | diff | comparison | revisions
libpurple/plugins/Makefile.am file | annotate | diff | comparison | revisions
libpurple/plugins/dbus-example.c file | annotate | diff | comparison | revisions
libpurple/plugins/log_reader.c file | annotate | diff | comparison | revisions
libpurple/plugins/perl/Makefile.am file | annotate | diff | comparison | revisions
libpurple/plugins/ssl/Makefile.am file | annotate | diff | comparison | revisions
libpurple/prefs.c file | annotate | diff | comparison | revisions
libpurple/protocols/jabber/Makefile.am file | annotate | diff | comparison | revisions
libpurple/protocols/jabber/iq.c file | annotate | diff | comparison | revisions
libpurple/protocols/mxit/mxit.h file | annotate | diff | comparison | revisions
libpurple/protocols/oscar/family_icbm.c file | annotate | diff | comparison | revisions
libpurple/protocols/oscar/family_locate.c file | annotate | diff | comparison | revisions
libpurple/protocols/oscar/oscar.h file | annotate | diff | comparison | revisions
libpurple/protocols/zephyr/Makefile.am file | annotate | diff | comparison | revisions
libpurple/protocols/zephyr/zephyr.c file | annotate | diff | comparison | revisions
libpurple/tests/Makefile.am file | annotate | diff | comparison | revisions
pidgin/Makefile.am file | annotate | diff | comparison | revisions
pidgin/gtkblist.c file | annotate | diff | comparison | revisions
pidgin/gtkconv.c file | annotate | diff | comparison | revisions
pidgin/gtkdialogs.c file | annotate | diff | comparison | revisions
pidgin/gtkdocklet.c file | annotate | diff | comparison | revisions
pidgin/gtkprefs.c file | annotate | diff | comparison | revisions
pidgin/gtkutils.c file | annotate | diff | comparison | revisions
pidgin/libpidgin.c file | annotate | diff | comparison | revisions
pidgin/pidgin.h file | annotate | diff | comparison | revisions
pidgin/plugins/Makefile.am file | annotate | diff | comparison | revisions
pidgin/plugins/cap/Makefile.am file | annotate | diff | comparison | revisions
pidgin/plugins/disco/Makefile.am file | annotate | diff | comparison | revisions
pidgin/plugins/disco/gtkdisco.c file | annotate | diff | comparison | revisions
pidgin/plugins/gestures/Makefile.am file | annotate | diff | comparison | revisions
pidgin/plugins/gevolution/Makefile.am file | annotate | diff | comparison | revisions
pidgin/plugins/musicmessaging/Makefile.am file | annotate | diff | comparison | revisions
pidgin/plugins/musicmessaging/musicmessaging.c file | annotate | diff | comparison | revisions
pidgin/plugins/ticker/Makefile.am file | annotate | diff | comparison | revisions
--- a/configure.ac	Tue Apr 15 20:01:46 2014 +0530
+++ b/configure.ac	Wed Apr 16 12:04:51 2014 +0530
@@ -126,16 +126,21 @@
 case "$host" in
 	*-*-mingw* | *-*-cygwin*)
 		is_win32="yes"
+		LIBS="$LIBS -lws2_32"
+		DNSAPI_LIBS="-ldnsapi"
+		AC_SUBST(DNSAPI_LIBS)
 		;;
 	*)
 		is_win32="no"
+		AC_CHECK_HEADERS(signal.h)
 		;;
 esac
+AM_CONDITIONAL(IS_WIN32, test "x$is_win32" = "xyes")
 
 dnl Checks for header files.
 AC_HEADER_STDC
 AC_HEADER_SYS_WAIT
-AC_CHECK_HEADERS(arpa/nameser_compat.h fcntl.h sys/time.h unistd.h locale.h signal.h stdint.h)
+AC_CHECK_HEADERS(arpa/nameser_compat.h fcntl.h sys/time.h unistd.h locale.h stdint.h)
 
 dnl Checks for typedefs, structures, and compiler characteristics.
 AC_C_CONST
@@ -146,6 +151,40 @@
 
 AC_C_BIGENDIAN
 
+dnl Check for directories
+if test "x$is_win32" = "xyes" ; then
+	purple_datadir="wpurple_data_dir()"
+	purple_libdir="wpurple_lib_dir()"
+	pidgin_libdir="wpurple_lib_dir()"
+	finch_libdir="wpurple_lib_dir()"
+	purple_sysconfdir="wpurple_sysconf_dir()"
+	purple_localedir="wpurple_locale_dir()"
+else
+	AS_AC_EXPAND(purple_datadir, "$datadir")
+	purple_datadir="\"$purple_datadir\""
+	AS_AC_EXPAND(purple_sysconfdir, "$sysconfdir")
+	purple_sysconfdir="\"$purple_sysconfdir\""
+	AS_AC_EXPAND(purple_localedir, "$localedir")
+	purple_localedir="\"$purple_localedir\""
+
+	AS_AC_EXPAND(common_libdir, "$libdir")
+	purple_libdir="\"$common_libdir/purple-$PURPLE_MAJOR_VERSION\""
+	pidgin_libdir="\"$common_libdir/pidgin\""
+	finch_libdir="\"$common_libdir/finch\""
+fi
+AC_DEFINE_UNQUOTED([PURPLE_DATADIR], [$purple_datadir],
+	[datadir to use, may expand into a function call that returns const char *])
+AC_DEFINE_UNQUOTED([PURPLE_LIBDIR], [$purple_libdir],
+	[libdir to use for libpurple, may expand into a function call that returns const char *])
+AC_DEFINE_UNQUOTED([PIDGIN_LIBDIR], [$pidgin_libdir],
+	[libdir to use for Pidgin, may expand into a function call that returns const char *])
+AC_DEFINE_UNQUOTED([FINCH_LIBDIR], [$finch_libdir],
+	[libdir to use for Finch, may expand into a function call that returns const char *])
+AC_DEFINE_UNQUOTED([PURPLE_SYSCONFDIR], [$purple_sysconfdir],
+	[sysconfdir to use, may expand into a function call that returns const char *])
+AC_DEFINE_UNQUOTED([PURPLE_LOCALEDIR], [$purple_localedir],
+	[localedir to use, may expand into a function call that returns const char *])
+
 dnl Checks for library functions.
 AC_TYPE_SIGNAL
 AC_FUNC_STRFTIME
@@ -1350,6 +1389,9 @@
 if test "x$silcincludes" != "xyes" -o "x$silcclient" != "xyes"; then
 	STATIC_PRPLS=`echo $STATIC_PRPLS | $sedpath 's/silc//'`
 fi
+if test "x$is_win32" = "xyes" ; then
+	STATIC_PRPLS=`echo $STATIC_PRPLS | $sedpath 's/zephyr//'`
+fi
 AC_SUBST(STATIC_PRPLS)
 STATIC_LINK_LIBS=
 extern_load=
@@ -1419,6 +1461,9 @@
 if test "x$silcincludes" != "xyes" -o "x$silcclient" != "xyes"; then
 	DYNAMIC_PRPLS=`echo $DYNAMIC_PRPLS | $sedpath 's/silc//'`
 fi
+if test "x$is_win32" = "xyes" ; then
+	DYNAMIC_PRPLS=`echo $DYNAMIC_PRPLS | $sedpath 's/zephyr//'`
+fi
 AC_SUBST(DYNAMIC_PRPLS)
 for i in $DYNAMIC_PRPLS ; do
 	case $i in
@@ -1952,6 +1997,10 @@
 	SSL_CERTIFICATES_DIR="$ssl_certificates_dir"
 fi
 AC_SUBST(SSL_CERTIFICATES_DIR)
+if test "x$SSL_CERTIFICATES_DIR" != "x" ; then
+	AC_DEFINE_UNQUOTED([SSL_CERTIFICATES_DIR], ["$SSL_CERTIFICATES_DIR"],
+		[Directory where SSL certificates can be found])
+fi
 AM_CONDITIONAL(INSTALL_SSL_CERTIFICATES, test "x$SSL_CERTIFICATES_DIR" = "x")
 
 dnl These two are inverses of each other <-- stolen from evolution!
--- a/doc/reference/finch/Makefile.am	Tue Apr 15 20:01:46 2014 +0530
+++ b/doc/reference/finch/Makefile.am	Wed Apr 16 12:04:51 2014 +0530
@@ -131,7 +131,7 @@
 if ENABLE_GTK_DOC
 TESTS_ENVIRONMENT = \
   DOC_MODULE=$(DOC_MODULE) DOC_MAIN_SGML_FILE=$(DOC_MAIN_SGML_FILE) \
-  SRCDIR=$(abs_srcdir) BUILDDIR=$(abs_builddir)
+  SRCDIR=$(abs_srcdir)
 #TODO: fix and enable
 #TESTS = $(GTKDOC_CHECK)
 endif
--- a/doc/reference/libpurple/Makefile.am	Tue Apr 15 20:01:46 2014 +0530
+++ b/doc/reference/libpurple/Makefile.am	Wed Apr 16 12:04:51 2014 +0530
@@ -176,7 +176,7 @@
 if ENABLE_GTK_DOC
 TESTS_ENVIRONMENT = \
   DOC_MODULE=$(DOC_MODULE) DOC_MAIN_SGML_FILE=$(DOC_MAIN_SGML_FILE) \
-  SRCDIR=$(abs_srcdir) BUILDDIR=$(abs_builddir)
+  SRCDIR=$(abs_srcdir)
 #TODO: fix and enable
 #TESTS = $(GTKDOC_CHECK)
 endif
--- a/doc/reference/libpurple/plugin_i18n.xml	Tue Apr 15 20:01:46 2014 +0530
+++ b/doc/reference/libpurple/plugin_i18n.xml	Wed Apr 16 12:04:51 2014 +0530
@@ -136,7 +136,7 @@
 Now add the following within your 'plugin_load' function:
 <programlisting>
 #ifdef ENABLE_NLS
-	bindtextdomain(GETTEXT_PACKAGE, LOCALEDIR);
+	bindtextdomain(GETTEXT_PACKAGE, PURPLE_LOCALEDIR);
 	bind_textdomain_codeset(GETTEXT_PACKAGE, "UTF-8");
 #endif /* ENABLE_NLS */
 
--- a/doc/reference/pidgin/Makefile.am	Tue Apr 15 20:01:46 2014 +0530
+++ b/doc/reference/pidgin/Makefile.am	Wed Apr 16 12:04:51 2014 +0530
@@ -148,7 +148,7 @@
 if ENABLE_GTK_DOC
 TESTS_ENVIRONMENT = \
   DOC_MODULE=$(DOC_MODULE) DOC_MAIN_SGML_FILE=$(DOC_MAIN_SGML_FILE) \
-  SRCDIR=$(abs_srcdir) BUILDDIR=$(abs_builddir)
+  SRCDIR=$(abs_srcdir)
 #TODO: fix and enable
 #TESTS = $(GTKDOC_CHECK)
 endif
--- a/finch/Makefile.am	Tue Apr 15 20:01:46 2014 +0530
+++ b/finch/Makefile.am	Wed Apr 16 12:04:51 2014 +0530
@@ -90,10 +90,6 @@
 
 AM_CPPFLAGS = \
 	-DSTANDALONE \
-	-DDATADIR=\"$(datadir)\" \
-	-DLIBDIR=\"$(libdir)/finch/\" \
-	-DLOCALEDIR=\"$(datadir)/locale\" \
-	-DSYSCONFDIR=\"$(sysconfdir)\" \
 	-I$(top_srcdir)/libpurple/ \
 	-I$(top_srcdir) \
 	-I$(srcdir)/libgnt/ \
--- a/finch/gntsound.c	Tue Apr 15 20:01:46 2014 +0530
+++ b/finch/gntsound.c	Wed Apr 16 12:04:51 2014 +0530
@@ -608,8 +608,8 @@
 		char *filename = g_strdup(purple_prefs_get_path(file_pref));
 		if (!filename || !strlen(filename)) {
 			g_free(filename);
-			/* XXX Consider creating a constant for "sounds/purple" to be shared with Pidgin */
-			filename = g_build_filename(DATADIR, "sounds", "purple", sounds[event].def, NULL);
+			filename = g_build_filename(PURPLE_DATADIR,
+				"sounds", "purple", sounds[event].def, NULL);
 		}
 
 		purple_sound_play_file(filename, NULL);
--- a/finch/libfinch.c	Tue Apr 15 20:01:46 2014 +0530
+++ b/finch/libfinch.c	Wed Apr 16 12:04:51 2014 +0530
@@ -280,7 +280,7 @@
 	};
 
 #ifdef ENABLE_NLS
-	bindtextdomain(PACKAGE, LOCALEDIR);
+	bindtextdomain(PACKAGE, PURPLE_LOCALEDIR);
 	bind_textdomain_codeset(PACKAGE, "UTF-8");
 	textdomain(PACKAGE);
 #endif
@@ -373,7 +373,7 @@
 	purple_plugins_add_search_path(path);
 	g_free(path);
 
-	purple_plugins_add_search_path(LIBDIR);
+	purple_plugins_add_search_path(FINCH_LIBDIR);
 	purple_plugins_refresh();
 
 	/* TODO: should this be moved into finch_prefs_init() ? */
--- a/finch/libgnt/wms/Makefile.am	Tue Apr 15 20:01:46 2014 +0530
+++ b/finch/libgnt/wms/Makefile.am	Wed Apr 16 12:04:51 2014 +0530
@@ -29,7 +29,6 @@
 EXTRA_DIST = 
 
 AM_CPPFLAGS = \
-	-DDATADIR=\"$(datadir)\" \
 	-I$(top_srcdir)/libpurple \
 	-I$(top_srcdir)/finch \
 	-I$(top_srcdir)/finch/libgnt \
--- a/finch/plugins/Makefile.am	Tue Apr 15 20:01:46 2014 +0530
+++ b/finch/plugins/Makefile.am	Wed Apr 16 12:04:51 2014 +0530
@@ -39,7 +39,6 @@
 EXTRA_DIST = pietray.py
 
 AM_CPPFLAGS = \
-	-DDATADIR=\"$(datadir)\" \
 	-I$(top_builddir)/libpurple \
 	-I$(top_srcdir)/libpurple \
 	-I$(top_srcdir) \
--- a/libpurple/Makefile.am	Tue Apr 15 20:01:46 2014 +0530
+++ b/libpurple/Makefile.am	Wed Apr 16 12:04:51 2014 +0530
@@ -208,6 +208,18 @@
 	xfer.h \
 	xmlnode.h
 
+if IS_WIN32
+purple_coresources += \
+	win32/giowin32.c \
+	win32/libc_interface.c \
+	win32/win32dep.c
+purple_coreheaders += \
+	win32/libc_interface.h \
+	win32/libc_internal.h \
+	win32/win32dep.h \
+	win32/wpurpleerror.h
+endif
+
 purple_mediaheaders = \
 	backend-iface.h \
 	candidate.h \
@@ -394,6 +406,7 @@
 libpurple_la_LIBADD = \
 	$(STATIC_LINK_LIBS) \
 	$(DBUS_LIBS) \
+	$(DNSAPI_LIBS) \
 	$(GLIB_LIBS) \
 	$(GPLUGIN_LIBS) \
 	$(LIBXML_LIBS) \
@@ -412,10 +425,6 @@
 	-lm
 
 AM_CPPFLAGS = \
-	-DDATADIR=\"$(datadir)\" \
-	-DLIBDIR=\"$(libdir)/purple-$(PURPLE_MAJOR_VERSION)/\" \
-	-DLOCALEDIR=\"$(datadir)/locale\" \
-	-DSYSCONFDIR=\"$(sysconfdir)\" \
 	$(GLIB_CFLAGS) \
 	$(GPLUGIN_CFLAGS) \
 	$(DEBUG_CFLAGS) \
@@ -433,12 +442,6 @@
 	$(ZLIB_CFLAGS) \
 	$(INTROSPECTION_CFLAGS)
 
-# INSTALL_SSL_CERTIFICATES is true when SSL_CERTIFICATES_DIR is empty.
-# We want to use SSL_CERTIFICATES_DIR when it's not empty.
-if ! INSTALL_SSL_CERTIFICATES
-AM_CPPFLAGS += -DSSL_CERTIFICATES_DIR=\"$(SSL_CERTIFICATES_DIR)\"
-endif
-
 -include $(INTROSPECTION_MAKEFILE)
 INTROSPECTION_GIRS =
 INTROSPECTION_SCANNER_ARGS = --warn-all
--- a/libpurple/certificate.c	Tue Apr 15 20:01:46 2014 +0530
+++ b/libpurple/certificate.c	Wed Apr 16 12:04:51 2014 +0530
@@ -918,15 +918,16 @@
 {
 	/* Attempt to point at the appropriate system path */
 	if (NULL == x509_ca_paths) {
+#ifdef SSL_CERTIFICATES_DIR
+		x509_ca_paths = g_list_append(x509_ca_paths,
+			g_strdup(SSL_CERTIFICATES_DIR));
+#endif
 #ifdef _WIN32
-		x509_ca_paths = g_list_append(NULL, g_build_filename(DATADIR,
-						   "ca-certs", NULL));
+		x509_ca_paths = g_list_append(x509_ca_paths, g_build_filename(
+			PURPLE_DATADIR, "ca-certs", NULL));
 #else
-# ifdef SSL_CERTIFICATES_DIR
-		x509_ca_paths = g_list_append(NULL, g_strdup(SSL_CERTIFICATES_DIR));
-# endif
-		x509_ca_paths = g_list_append(x509_ca_paths,
-			g_build_filename(DATADIR, "purple", "ca-certs", NULL));
+		x509_ca_paths = g_list_append(x509_ca_paths, g_build_filename(
+			PURPLE_DATADIR, "purple", "ca-certs", NULL));
 #endif
 	}
 
--- a/libpurple/core.c	Tue Apr 15 20:01:46 2014 +0530
+++ b/libpurple/core.c	Wed Apr 16 12:04:51 2014 +0530
@@ -108,7 +108,7 @@
 	g_return_val_if_fail(purple_get_core() == NULL, FALSE);
 
 #ifdef ENABLE_NLS
-	bindtextdomain(PACKAGE, LOCALEDIR);
+	bindtextdomain(PACKAGE, PURPLE_LOCALEDIR);
 #endif
 #ifdef _WIN32
 	wpurple_init();
--- a/libpurple/dbus-server.h	Tue Apr 15 20:01:46 2014 +0530
+++ b/libpurple/dbus-server.h	Wed Apr 16 12:04:51 2014 +0530
@@ -210,7 +210,9 @@
  * dbus-analyze-functions.py is run without the "--export-only" option,
  * this prefix is ignored.
  */
+#ifndef DBUS_EXPORT
 #define DBUS_EXPORT
+#endif
 
 /*
    Here we include the list of #PURPLE_DBUS_DECLARE_TYPE statements for
--- a/libpurple/dnsquery.c	Tue Apr 15 20:01:46 2014 +0530
+++ b/libpurple/dnsquery.c	Wed Apr 16 12:04:51 2014 +0530
@@ -729,8 +729,10 @@
 dns_thread(gpointer data)
 {
 	PurpleDnsQueryData *query_data;
+#if defined(HAVE_GETADDRINFO) || defined(USE_IDN)
+	int rc;
+#endif
 #ifdef HAVE_GETADDRINFO
-	int rc;
 	struct addrinfo hints, *res, *tmp;
 	char servname[20];
 #else
--- a/libpurple/dnssrv.c	Tue Apr 15 20:01:46 2014 +0530
+++ b/libpurple/dnssrv.c	Wed Apr 16 12:04:51 2014 +0530
@@ -702,7 +702,7 @@
 				txtres = g_new0(PurpleTxtResponse, 1);
 
 				s = g_string_new("");
-				for (i = 0; i < txt_data->dwStringCount; ++i)
+				for (i = 0; i < (int)txt_data->dwStringCount; ++i)
 					s = g_string_append(s, txt_data->pStringArray[i]);
 				txtres->content = g_string_free(s, FALSE);
 
--- a/libpurple/example/Makefile.am	Tue Apr 15 20:01:46 2014 +0530
+++ b/libpurple/example/Makefile.am	Wed Apr 16 12:04:51 2014 +0530
@@ -13,10 +13,6 @@
 
 AM_CPPFLAGS = \
 	-DSTANDALONE \
-	-DDATADIR=\"$(datadir)\" \
-	-DLIBDIR=\"$(libdir)/purple-$(PURPLE_MAJOR_VERSION)/\" \
-	-DLOCALEDIR=\"$(datadir)/locale\" \
-	-DSYSCONFDIR=\"$(sysconfdir)\" \
 	-I$(top_builddir)/libpurple \
 	-I$(top_srcdir)/libpurple \
 	-I$(top_srcdir) \
--- a/libpurple/example/nullclient.c	Tue Apr 15 20:01:46 2014 +0530
+++ b/libpurple/example/nullclient.c	Wed Apr 16 12:04:51 2014 +0530
@@ -24,13 +24,15 @@
 #include "purple.h"
 
 #include <glib.h>
+#include <glib/gprintf.h>
 
 #include <signal.h>
 #include <string.h>
-#ifndef _WIN32
-#include <unistd.h>
+#ifdef _WIN32
+#  include <conio.h>
+#  include "win32/win32dep.h"
 #else
-#include "win32/win32dep.h"
+#  include <unistd.h>
 #endif
 
 #include "defines.h"
@@ -237,6 +239,36 @@
 				PURPLE_CALLBACK(signed_on), NULL);
 }
 
+#if defined(_WIN32) || defined(__BIONIC__)
+#ifndef PASS_MAX
+#  define PASS_MAX 1024
+#endif
+static gchar *
+getpass(const gchar *prompt)
+{
+	static gchar buff[PASS_MAX + 1];
+	guint i = 0;
+
+	g_fprintf(stderr, "%s", prompt);
+	fflush(stderr);
+
+	while (i < sizeof(buff) - 1) {
+#ifdef __BIONIC__
+		buff[i] = getc(stdin);
+#else
+		buff[i] = _getch();
+#endif
+		if (buff[i] == '\r' || buff[i] == '\n')
+			break;
+		i++;
+	}
+	buff[i] = '\0';
+	g_fprintf(stderr, "\n");
+
+	return buff;
+}
+#endif /* _WIN32 || __BIONIC__ */
+
 int main(int argc, char *argv[])
 {
 	GList *list, *iter;
--- a/libpurple/plugins.c	Tue Apr 15 20:01:46 2014 +0530
+++ b/libpurple/plugins.c	Wed Apr 16 12:04:51 2014 +0530
@@ -1117,7 +1117,7 @@
 	gplugin_init();
 	gplugin_manager_add_default_paths();
 
-	purple_plugins_add_search_path(LIBDIR);
+	purple_plugins_add_search_path(PURPLE_LIBDIR);
 
 	g_signal_connect(gplugin_manager_get_instance(), "loading-plugin",
 	                 G_CALLBACK(plugin_loading_cb), NULL);
--- a/libpurple/plugins/Makefile.am	Tue Apr 15 20:01:46 2014 +0530
+++ b/libpurple/plugins/Makefile.am	Wed Apr 16 12:04:51 2014 +0530
@@ -128,7 +128,6 @@
 	startup.py
 
 AM_CPPFLAGS = \
-	-DDATADIR=\"$(datadir)\" \
 	-I$(top_srcdir)/libpurple \
 	-I$(top_builddir)/libpurple \
 	$(DEBUG_CFLAGS) \
--- a/libpurple/plugins/dbus-example.c	Tue Apr 15 20:01:46 2014 +0530
+++ b/libpurple/plugins/dbus-example.c	Wed Apr 16 12:04:51 2014 +0530
@@ -79,12 +79,12 @@
 static PurpleText hello;
 
 /* Here come the definitions of the four exported functions. */
-PurpleText* dbus_example_get_hello_object(void)
+DBUS_EXPORT PurpleText* dbus_example_get_hello_object(void)
 {
 	return &hello;
 }
 
-void dbus_example_set_text(PurpleText *obj, const char *text)
+DBUS_EXPORT void dbus_example_set_text(PurpleText *obj, const char *text)
 {
 	if (obj != NULL) {
 		g_free(obj->text);
@@ -92,7 +92,7 @@
 	}
 }
 
-const char *dbus_example_get_text(PurpleText *obj)
+DBUS_EXPORT const char *dbus_example_get_text(PurpleText *obj)
 {
 	if (obj != NULL)
 		return obj->text;
@@ -100,7 +100,7 @@
 		return NULL;
 }
 
-const char *dbus_example_get_buddy_name(PurpleBuddy *buddy)
+DBUS_EXPORT const char *dbus_example_get_buddy_name(PurpleBuddy *buddy)
 {
 	return purple_buddy_get_name(buddy);
 }
--- a/libpurple/plugins/log_reader.c	Tue Apr 15 20:01:46 2014 +0530
+++ b/libpurple/plugins/log_reader.c	Wed Apr 16 12:04:51 2014 +0530
@@ -13,11 +13,6 @@
 #include "version.h"
 #include "xmlnode.h"
 
-/* This must be the last Purple header included. */
-#ifdef _WIN32
-#include "win32dep.h"
-#endif
-
 /* Where is the Windows partition mounted? */
 #ifndef PURPLE_LOG_READER_WINDOWS_MOUNT_POINT
 #define PURPLE_LOG_READER_WINDOWS_MOUNT_POINT "/mnt/windows"
--- a/libpurple/plugins/perl/Makefile.am	Tue Apr 15 20:01:46 2014 +0530
+++ b/libpurple/plugins/perl/Makefile.am	Wed Apr 16 12:04:51 2014 +0530
@@ -163,7 +163,6 @@
 	-I$(top_srcdir) \
 	-I$(top_srcdir)/libpurple \
 	-I$(top_builddir)/libpurple \
-	-DLIBDIR=\"$(libdir)/purple-$(PURPLE_MAJOR_VERSION)\" \
 	$(DEBUG_CFLAGS) \
 	$(GLIB_CFLAGS) \
 	$(GPLUGIN_CFLAGS) \
--- a/libpurple/plugins/ssl/Makefile.am	Tue Apr 15 20:01:46 2014 +0530
+++ b/libpurple/plugins/ssl/Makefile.am	Wed Apr 16 12:04:51 2014 +0530
@@ -31,8 +31,6 @@
 endif # PLUGINS
 
 AM_CPPFLAGS = \
-	-DDATADIR=\"$(datadir)\" \
-	-DLIBDIR=\"$(libdir)/libpurple\" \
 	-I$(top_srcdir)/libpurple \
 	-I$(top_builddir)/libpurple \
 	$(DEBUG_CFLAGS) \
--- a/libpurple/prefs.c	Tue Apr 15 20:01:46 2014 +0530
+++ b/libpurple/prefs.c	Wed Apr 16 12:04:51 2014 +0530
@@ -35,10 +35,6 @@
 #include "debug.h"
 #include "util.h"
 
-#ifdef _WIN32
-#include "win32dep.h"
-#endif
-
 struct pref_cb {
 	PurplePrefCallback func;
 	gpointer data;
@@ -394,20 +390,15 @@
 	purple_debug_misc("prefs", "Reading %s", filename);
 
 	if(!g_file_get_contents(filename, &contents, &length, &error)) {
-#ifdef _WIN32
-		gchar *common_appdata = wpurple_get_special_folder(CSIDL_COMMON_APPDATA);
-#endif
+		const gchar *sysconfdir = PURPLE_SYSCONFDIR;
 		g_free(filename);
 		g_error_free(error);
 
 		error = NULL;
 
-#ifdef _WIN32
-		filename = g_build_filename(common_appdata ? common_appdata : "", "purple", "prefs.xml", NULL);
-		g_free(common_appdata);
-#else
-		filename = g_build_filename(SYSCONFDIR, "purple", "prefs.xml", NULL);
-#endif
+		if (sysconfdir == NULL)
+			sysconfdir = "";
+		filename = g_build_filename(sysconfdir, "purple", "prefs.xml", NULL);
 
 		purple_debug_info("prefs", "Reading %s\n", filename);
 
--- a/libpurple/protocols/gg/lib/fileio.h	Tue Apr 15 20:01:46 2014 +0530
+++ b/libpurple/protocols/gg/lib/fileio.h	Wed Apr 16 12:04:51 2014 +0530
@@ -34,11 +34,17 @@
 #ifdef _WIN32
 #  include <io.h>
 #  define gg_file_close _close
+#  undef lseek
 #  define lseek _lseek
+#  undef open
 #  define open _open
+#  undef read
 #  define read _read
+#  undef stat
 #  define stat _stat
+#  undef fstat
 #  define fstat _fstat
+#  undef write
 #  define write _write
 #  define S_IRWXO 0
 #  define S_IRWXG 0
--- a/libpurple/protocols/jabber/Makefile.am	Tue Apr 15 20:01:46 2014 +0530
+++ b/libpurple/protocols/jabber/Makefile.am	Wed Apr 16 12:04:51 2014 +0530
@@ -107,6 +107,10 @@
 JABBERSOURCES += auth_cyrus.c
 endif
 
+if IS_WIN32
+JABBERSOURCES += win32/posix.uname.c
+endif
+
 if STATIC_JABBER
 
 st = -DPURPLE_STATIC_PRPL
--- a/libpurple/protocols/jabber/iq.c	Tue Apr 15 20:01:46 2014 +0530
+++ b/libpurple/protocols/jabber/iq.c	Wed Apr 16 12:04:51 2014 +0530
@@ -43,7 +43,7 @@
 #include "ibb.h"
 
 #ifdef _WIN32
-#include "utsname.h"
+#include "win32/utsname.h"
 #endif
 
 static GHashTable *iq_handlers = NULL;
--- a/libpurple/protocols/mxit/mxit.h	Tue Apr 15 20:01:46 2014 +0530
+++ b/libpurple/protocols/mxit/mxit.h	Wed Apr 16 12:04:51 2014 +0530
@@ -40,7 +40,6 @@
 #ifndef HOST_NAME_MAX
 #define		HOST_NAME_MAX				512
 #endif
-#include	"libc_interface.h"
 #elif defined( __linux__ )
 /* linux architecture */
 #include	<net/if.h>
--- a/libpurple/protocols/oscar/family_icbm.c	Tue Apr 15 20:01:46 2014 +0530
+++ b/libpurple/protocols/oscar/family_icbm.c	Wed Apr 16 12:04:51 2014 +0530
@@ -48,10 +48,6 @@
 #include "oscar.h"
 #include "peer.h"
 
-#ifdef _WIN32
-#include "win32dep.h"
-#endif
-
 #include "util.h"
 
 static const char * const errcodereason[] = {
--- a/libpurple/protocols/oscar/family_locate.c	Tue Apr 15 20:01:46 2014 +0530
+++ b/libpurple/protocols/oscar/family_locate.c	Wed Apr 16 12:04:51 2014 +0530
@@ -27,9 +27,6 @@
  */
 
 #include "oscar.h"
-#ifdef _WIN32
-#include "win32dep.h"
-#endif
 
 /* Define to log unknown TLVs */
 /* #define LOG_UNKNOWN_TLV */
--- a/libpurple/protocols/oscar/flap_connection.c	Tue Apr 15 20:01:46 2014 +0530
+++ b/libpurple/protocols/oscar/flap_connection.c	Wed Apr 16 12:04:51 2014 +0530
@@ -29,10 +29,6 @@
 #include <netinet/in.h>
 #endif
 
-#ifdef _WIN32
-#include "win32dep.h"
-#endif
-
 /**
  * This sends a channel 1 SNAC containing the FLAP version.
  * The FLAP version is sent by itself at the beginning of every
--- a/libpurple/protocols/oscar/oscar.h	Tue Apr 15 20:01:46 2014 +0530
+++ b/libpurple/protocols/oscar/oscar.h	Wed Apr 16 12:04:51 2014 +0530
@@ -52,8 +52,6 @@
 #include <netdb.h>
 #include <netinet/in.h>
 #include <sys/socket.h>
-#else
-#include "libc_interface.h"
 #endif
 
 #define OSCAR_TYPE_PROTOCOL             (oscar_protocol_get_type())
--- a/libpurple/protocols/oscar/peer.c	Tue Apr 15 20:01:46 2014 +0530
+++ b/libpurple/protocols/oscar/peer.c	Wed Apr 16 12:04:51 2014 +0530
@@ -50,10 +50,6 @@
 #include <limits.h> /* for UINT_MAX */
 #endif
 
-#ifdef _WIN32
-#include "win32dep.h"
-#endif
-
 /*
  * I really want to switch all our networking code to using IPv6 only,
  * but that really isn't a good idea at all.  Evan S. of Adium says
--- a/libpurple/protocols/oscar/util.c	Tue Apr 15 20:01:46 2014 +0530
+++ b/libpurple/protocols/oscar/util.c	Wed Apr 16 12:04:51 2014 +0530
@@ -31,10 +31,6 @@
 
 #include <ctype.h>
 
-#ifdef _WIN32
-#include "win32dep.h"
-#endif
-
 static const char * const msgerrreason[] = {
 	N_("Invalid error"),
 	N_("Invalid SNAC"),
--- a/libpurple/protocols/zephyr/Makefile.am	Tue Apr 15 20:01:46 2014 +0530
+++ b/libpurple/protocols/zephyr/Makefile.am	Wed Apr 16 12:04:51 2014 +0530
@@ -104,7 +104,6 @@
 	-I$(top_srcdir)/libpurple \
 	-I$(top_builddir)/libpurple \
 	-I$(top_srcdir)/libpurple/protocols \
-	-DCONFDIR=\"$(sysconfdir)\" \
 	$(GLIB_CFLAGS) \
 	$(GPLUGIN_CFLAGS) \
 	$(KRB4_CFLAGS) \
--- a/libpurple/protocols/zephyr/ZVariables.c	Tue Apr 15 20:01:46 2014 +0530
+++ b/libpurple/protocols/zephyr/ZVariables.c	Wed Apr 16 12:04:51 2014 +0530
@@ -35,10 +35,10 @@
 	if (ret != ZERR_NONE)
 		return ret;
 
-#ifdef WIN32
+#ifdef _WIN32
 	varfile = g_strdup("C:\\zephyr\\zephyr.var");
 #else
-	varfile = g_strdup_printf("%s/zephyr.vars", CONFDIR);
+	varfile = g_build_filename(PURPLE_SYSCONFDIR, "zephyr.vars", NULL);
 #endif
 	ret = get_varval(varfile, var);
 	g_free(varfile);
--- a/libpurple/protocols/zephyr/zephyr.c	Tue Apr 15 20:01:46 2014 +0530
+++ b/libpurple/protocols/zephyr/zephyr.c	Wed Apr 16 12:04:51 2014 +0530
@@ -2241,6 +2241,12 @@
 	PurpleConnection *gc;
 	char *tmp;
 
+	if (account == NULL) {
+		if (strlen(who) >= sizeof(buf))
+			return NULL;
+		return who;
+	}
+
 	gc = purple_account_get_connection(account);
 	if (gc == NULL)
 		return NULL;
--- a/libpurple/tests/Makefile.am	Tue Apr 15 20:01:46 2014 +0530
+++ b/libpurple/tests/Makefile.am	Wed Apr 16 12:04:51 2014 +0530
@@ -28,8 +28,7 @@
 		$(DEBUG_CFLAGS) \
 		$(LIBXML_CFLAGS) \
 		-I.. \
-		-I$(top_srcdir)/libpurple \
-		-DBUILDDIR=\"$(top_builddir)\"
+		-I$(top_srcdir)/libpurple
 
 check_libpurple_LDADD=\
 		$(top_builddir)/libpurple/protocols/jabber/libjabber.la \
--- a/libpurple/tests/check_libpurple.c	Tue Apr 15 20:01:46 2014 +0530
+++ b/libpurple/tests/check_libpurple.c	Wed Apr 16 12:04:51 2014 +0530
@@ -46,7 +46,7 @@
 	{
 		gchar *home_dir;
 
-		home_dir = g_build_path(G_DIR_SEPARATOR_S, BUILDDIR, "libpurple", "tests", "home", NULL);
+		home_dir = g_build_path(G_DIR_SEPARATOR_S, $(top_builddir), "libpurple", "tests", "home", NULL);
 		purple_util_set_user_dir(home_dir);
 		g_free(home_dir);
 	}
--- a/libpurple/win32/giowin32.c	Tue Apr 15 20:01:46 2014 +0530
+++ b/libpurple/win32/giowin32.c	Wed Apr 16 12:04:51 2014 +0530
@@ -222,7 +222,7 @@
   int len;
 
   channel->reset_send = (gint) socket (AF_INET, SOCK_DGRAM, 0);
-  if (channel->reset_send == INVALID_SOCKET)
+  if (channel->reset_send == (gint)INVALID_SOCKET)
     {
       g_warning (G_STRLOC ": Error creating reset_send socket: %s\n",
 		 g_win32_error_message (WSAGetLastError ()));
@@ -243,7 +243,7 @@
   local2.sin_addr.s_addr = htonl (INADDR_LOOPBACK);
 
   channel->reset_recv = (gint) socket (AF_INET, SOCK_DGRAM, 0);
-  if (channel->reset_recv == INVALID_SOCKET)
+  if (channel->reset_recv == (gint)INVALID_SOCKET)
     {
       g_warning (G_STRLOC ": Error creating reset_recv socket: %s\n",
 		 g_win32_error_message (WSAGetLastError ()));
@@ -603,9 +603,9 @@
 	     win32_channel->thread_id,
 	     win32_channel->fd);
 
-  if (win32_channel->reset_send && win32_channel->reset_send != INVALID_SOCKET)
+  if (win32_channel->reset_send && win32_channel->reset_send != (gint)INVALID_SOCKET)
     closesocket (win32_channel->reset_send);
-  if (win32_channel->reset_recv && win32_channel->reset_recv != INVALID_SOCKET)
+  if (win32_channel->reset_recv && win32_channel->reset_recv != (gint)INVALID_SOCKET)
     closesocket (win32_channel->reset_recv);
   if (win32_channel->data_avail_event)
     CloseHandle (win32_channel->data_avail_event);
--- a/libpurple/win32/libc_interface.c	Tue Apr 15 20:01:46 2014 +0530
+++ b/libpurple/win32/libc_interface.c	Wed Apr 16 12:04:51 2014 +0530
@@ -82,7 +82,7 @@
 
 	ret = socket( namespace, style, protocol );
 
-	if( ret == INVALID_SOCKET ) {
+	if (ret == (int)INVALID_SOCKET) {
 		errno = WSAGetLastError();
 		return -1;
 	}
--- a/libpurple/win32/win32dep.c	Tue Apr 15 20:01:46 2014 +0530
+++ b/libpurple/win32/win32dep.c	Wed Apr 16 12:04:51 2014 +0530
@@ -34,7 +34,7 @@
  * LOCALS
  */
 static char *app_data_dir = NULL, *install_dir = NULL,
-	*lib_dir = NULL, *locale_dir = NULL;
+	*lib_dir = NULL, *locale_dir = NULL, *sysconf_dir = NULL;
 
 static HINSTANCE libpurpledll_hInstance = NULL;
 
@@ -208,6 +208,18 @@
 	return app_data_dir;
 }
 
+const char *wpurple_sysconf_dir(void)
+{
+	static gboolean initialized = FALSE;
+
+	if (!initialized) {
+		sysconf_dir = wpurple_get_special_folder(CSIDL_COMMON_APPDATA);
+		initialized = TRUE;
+	}
+
+	return sysconf_dir;
+}
+
 /* Miscellaneous */
 
 gboolean wpurple_write_reg_string(HKEY rootkey, const char *subkey, const char *valname,
@@ -532,11 +544,13 @@
 	g_free(install_dir);
 	g_free(lib_dir);
 	g_free(locale_dir);
+	g_free(sysconf_dir);
 
 	app_data_dir = NULL;
 	install_dir = NULL;
 	lib_dir = NULL;
 	locale_dir = NULL;
+	sysconf_dir = NULL;
 
 	libpurpledll_hInstance = NULL;
 }
--- a/libpurple/win32/win32dep.h	Tue Apr 15 20:01:46 2014 +0530
+++ b/libpurple/win32/win32dep.h	Wed Apr 16 12:04:51 2014 +0530
@@ -70,6 +70,7 @@
 const char *wpurple_lib_dir(void);
 const char *wpurple_locale_dir(void);
 const char *wpurple_data_dir(void);
+const char *wpurple_sysconf_dir(void);
 
 /* init / cleanup */
 void wpurple_init(void);
@@ -77,17 +78,6 @@
 
 long wpurple_get_tz_offset(void);
 
-/*
- *  MACROS
- */
-
-/*
- *  Purple specific
- */
-#define DATADIR wpurple_install_dir()
-#define LIBDIR wpurple_lib_dir()
-#define LOCALEDIR wpurple_locale_dir()
-
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
--- a/m4macros/Makefile.am	Tue Apr 15 20:01:46 2014 +0530
+++ b/m4macros/Makefile.am	Wed Apr 16 12:04:51 2014 +0530
@@ -1,6 +1,6 @@
 installed_m4=purple.m4
 
-EXTRA_DIST=$(installed_m4)
+EXTRA_DIST=$(installed_m4) as-ac-expand.m4
 
 m4datadir=$(datadir)/aclocal
 m4data_DATA=$(installed_m4)
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/m4macros/as-ac-expand.m4	Wed Apr 16 12:04:51 2014 +0530
@@ -0,0 +1,49 @@
+dnl as-ac-expand.m4 0.2.0                                   -*- autoconf -*-
+dnl autostars m4 macro for expanding directories using configure's prefix
+
+dnl (C) 2003, 2004, 2005 Thomas Vander Stichele <thomas at apestaart dot org>
+
+dnl Copying and distribution of this file, with or without modification,
+dnl are permitted in any medium without royalty provided the copyright
+dnl notice and this notice are preserved.
+
+dnl AS_AC_EXPAND(VAR, CONFIGURE_VAR)
+
+dnl example:
+dnl AS_AC_EXPAND(SYSCONFDIR, $sysconfdir)
+dnl will set SYSCONFDIR to /usr/local/etc if prefix=/usr/local
+
+AC_DEFUN([AS_AC_EXPAND],
+[
+  EXP_VAR=[$1]
+  FROM_VAR=[$2]
+
+  dnl first expand prefix and exec_prefix if necessary
+  prefix_save=$prefix
+  exec_prefix_save=$exec_prefix
+
+  dnl if no prefix given, then use /usr/local, the default prefix
+  if test "x$prefix" = "xNONE"; then
+    prefix="$ac_default_prefix"
+  fi
+  dnl if no exec_prefix given, then use prefix
+  if test "x$exec_prefix" = "xNONE"; then
+    exec_prefix=$prefix
+  fi
+
+  full_var="$FROM_VAR"
+  dnl loop until it doesn't change anymore
+  while true; do
+    new_full_var="`eval echo $full_var`"
+    if test "x$new_full_var" = "x$full_var"; then break; fi
+    full_var=$new_full_var
+  done
+
+  dnl clean up
+  full_var=$new_full_var
+  AC_SUBST([$1], "$full_var")
+
+  dnl restore prefix and exec_prefix
+  prefix=$prefix_save
+  exec_prefix=$exec_prefix_save
+])
--- a/pidgin/Makefile.am	Tue Apr 15 20:01:46 2014 +0530
+++ b/pidgin/Makefile.am	Wed Apr 16 12:04:51 2014 +0530
@@ -144,6 +144,31 @@
 
 noinst_HEADERS= gtkinternal.h
 
+if IS_WIN32
+libpidgin_la_SOURCES += \
+	win32/gtkwin32dep.c \
+	win32/untar.c \
+	win32/wspell.c
+
+# Files that looks like obsolete (were used in Pidgin2):
+#	win32/gtkdocklet-win32.c
+#	win32/MinimizeToTray.c
+#	win32/MinimizeToTray.h
+
+# Files not yet handled:
+#	win32/pidgin_dll_rc.rc
+#	win32/pidgin_exe_rc.rc
+
+pidgin_SOURCES += \
+	win32/winpidgin.c
+
+libpidgin_la_headers += \
+	win32/gtkwin32dep.h \
+	win32/resource.h \
+	win32/untar.h \
+	win32/wspell.h
+endif
+
 libpidginincludedir=$(includedir)/pidgin
 libpidgininclude_HEADERS = \
 	$(libpidgin_la_headers)
@@ -183,15 +208,16 @@
 	$(INTROSPECTION_LIBS) \
 	$(top_builddir)/libpurple/libpurple.la
 
+if IS_WIN32
+libpidgin_la_LIBADD += \
+	-lwinmm
+endif
+
 pidgin_DEPENDENCIES = $(builddir)/libpidgin.la
 pidgin_LDFLAGS = -export-dynamic
 pidgin_LDADD = $(builddir)/libpidgin.la $(libpidgin_la_LIBADD)
 
 AM_CPPFLAGS = \
-	-DDATADIR=\"$(datadir)\" \
-	-DLIBDIR=\"$(libdir)/pidgin/\" \
-	-DLOCALEDIR=\"$(datadir)/locale\" \
-	-DSYSCONFDIR=\"$(sysconfdir)\" \
 	-I$(top_builddir)/libpurple \
 	-I$(top_srcdir)/libpurple/ \
 	-I$(top_builddir) \
--- a/pidgin/gtkblist.c	Tue Apr 15 20:01:46 2014 +0530
+++ b/pidgin/gtkblist.c	Wed Apr 16 12:04:51 2014 +0530
@@ -3413,15 +3413,15 @@
 	char *path;
 
 	if (!strcmp(mood, "busy")) {
-		path = g_build_filename(DATADIR, "pixmaps", "pidgin",
-		                        "status", "16", "busy.png", NULL);
+		path = g_build_filename(PURPLE_DATADIR, "pixmaps", "pidgin",
+			"status", "16", "busy.png", NULL);
 	} else if (!strcmp(mood, "hiptop")) {
-		path = g_build_filename(DATADIR, "pixmaps", "pidgin",
-		                        "emblems", "16", "hiptop.png", NULL);
+		path = g_build_filename(PURPLE_DATADIR, "pixmaps", "pidgin",
+			"emblems", "16", "hiptop.png", NULL);
 	} else {
 		char *filename = g_strdup_printf("%s.png", mood);
-		path = g_build_filename(DATADIR, "pixmaps", "pidgin",
-		                        "emotes", "small", filename, NULL);
+		path = g_build_filename(PURPLE_DATADIR, "pixmaps", "pidgin",
+			"emotes", "small", filename, NULL);
 		g_free(filename);
 	}
 	return path;
@@ -4108,8 +4108,8 @@
 		if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_MOBILE)) {
 			/* This emblem comes from the small emoticon set now,
 			 * to reduce duplication. */
-			path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emotes",
-						"small", "mobile.png", NULL);
+			path = g_build_filename(PURPLE_DATADIR, "pixmaps",
+				"pidgin", "emotes", "small", "mobile.png", NULL);
 			return _pidgin_blist_get_cached_emblem(path);
 		}
 
@@ -4125,7 +4125,8 @@
 	g_return_val_if_fail(buddy != NULL, NULL);
 
 	if (!purple_account_privacy_check(purple_buddy_get_account(buddy), purple_buddy_get_name(buddy))) {
-		path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emblems", "16", "blocked.png", NULL);
+		path = g_build_filename(PURPLE_DATADIR, "pixmaps", "pidgin",
+			"emblems", "16", "blocked.png", NULL);
 		return _pidgin_blist_get_cached_emblem(path);
 	}
 
@@ -4136,7 +4137,8 @@
 
 	if (purple_presence_is_status_primitive_active(p, PURPLE_STATUS_MOBILE)) {
 		/* This emblem comes from the small emoticon set now, to reduce duplication. */
-		path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emotes", "small", "mobile.png", NULL);
+		path = g_build_filename(PURPLE_DATADIR, "pixmaps", "pidgin",
+			"emotes", "small", "mobile.png", NULL);
 		return _pidgin_blist_get_cached_emblem(path);
 	}
 
@@ -4145,18 +4147,21 @@
 		/* Only in MSN.
 		 * TODO: Replace "Tune" with generalized "Media" in 3.0. */
 		if (purple_status_get_attr_string(tune, "game") != NULL) {
-			path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emblems", "16", "game.png", NULL);
+			path = g_build_filename(PURPLE_DATADIR, "pixmaps",
+				"pidgin", "emblems", "16", "game.png", NULL);
 			return _pidgin_blist_get_cached_emblem(path);
 		}
 		/* Only in MSN.
 		 * TODO: Replace "Tune" with generalized "Media" in 3.0. */
 		if (purple_status_get_attr_string(tune, "office") != NULL) {
-			path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emblems", "16", "office.png", NULL);
+			path = g_build_filename(PURPLE_DATADIR, "pixmaps",
+				"pidgin", "emblems", "16", "office.png", NULL);
 			return _pidgin_blist_get_cached_emblem(path);
 		}
 		/* Regular old "tune" is the only one in all protocols. */
 		/* This emblem comes from the small emoticon set now, to reduce duplication. */
-		path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emotes", "small", "music.png", NULL);
+		path = g_build_filename(PURPLE_DATADIR, "pixmaps", "pidgin",
+			"emotes", "small", "music.png", NULL);
 		return _pidgin_blist_get_cached_emblem(path);
 	}
 
@@ -4181,7 +4186,8 @@
 		path = get_mood_icon_path(name);
 	} else {
 		filename = g_strdup_printf("%s.png", name);
-		path = g_build_filename(DATADIR, "pixmaps", "pidgin", "emblems", "16", filename, NULL);
+		path = g_build_filename(PURPLE_DATADIR, "pixmaps", "pidgin",
+			"emblems", "16", filename, NULL);
 		g_free(filename);
 	}
 
--- a/pidgin/gtkconv-theme.c	Tue Apr 15 20:01:46 2014 +0530
+++ b/pidgin/gtkconv-theme.c	Wed Apr 16 12:04:51 2014 +0530
@@ -126,9 +126,11 @@
 	if (!g_file_test(file, G_FILE_TEST_EXISTS)) {
 		g_free(file);
 #ifdef _WIN32
-		file = g_build_filename(DATADIR, "theme", "Template.html", NULL);
+		file = g_build_filename(PURPLE_DATADIR,
+			"theme", "Template.html", NULL);
 #else
-		file = g_build_filename(DATADIR, "pidgin", "theme", "Template.html", NULL);
+		file = g_build_filename(PURPLE_DATADIR,
+			"pidgin", "theme", "Template.html", NULL);
 #endif
 	}
 
--- a/pidgin/gtkconv.c	Tue Apr 15 20:01:46 2014 +0530
+++ b/pidgin/gtkconv.c	Wed Apr 16 12:04:51 2014 +0530
@@ -4169,8 +4169,8 @@
 		return image;
 
 	g_snprintf(filename, sizeof(filename), "%s.png", stock_name);
-	path = g_build_filename(DATADIR, "pixmaps", "pidgin", "e2ee", "16",
-		filename, NULL);
+	path = g_build_filename(PURPLE_DATADIR, "pixmaps", "pidgin",
+		"e2ee", "16", filename, NULL);
 	image = purple_image_new_from_file(path, FALSE);
 	g_free(path);
 
@@ -8959,9 +8959,9 @@
 
 	purple_theme_manager_register_type(g_object_new(PIDGIN_TYPE_CONV_THEME_LOADER, "type", "conversation", NULL));
 #ifdef _WIN32
-	theme_dir = g_build_filename(DATADIR, "theme", NULL);
+	theme_dir = g_build_filename(PURPLE_DATADIR, "theme", NULL);
 #else
-	theme_dir = g_build_filename(DATADIR, "pidgin", "theme", NULL);
+	theme_dir = g_build_filename(PURPLE_DATADIR, "pidgin", "theme", NULL);
 #endif
 	default_conv_theme = purple_theme_manager_load_theme(theme_dir, "conversation");
 	g_free(theme_dir);
--- a/pidgin/gtkdialogs.c	Tue Apr 15 20:01:46 2014 +0530
+++ b/pidgin/gtkdialogs.c	Wed Apr 16 12:04:51 2014 +0530
@@ -463,7 +463,8 @@
 	gtk_window_set_default_size(GTK_WINDOW(win), 475, 450);
 
 	/* Generate a logo with a version number */
-	filename = g_build_filename(DATADIR, "pixmaps", "pidgin", "logo.png", NULL);
+	filename = g_build_filename(PURPLE_DATADIR,
+		"pixmaps", "pidgin", "logo.png", NULL);
 	pixbuf = pidgin_pixbuf_new_from_file(filename);
 	g_free(filename);
 
--- a/pidgin/gtkdnd-hints.c	Tue Apr 15 20:01:46 2014 +0530
+++ b/pidgin/gtkdnd-hints.c	Wed Apr 16 12:04:51 2014 +0530
@@ -21,13 +21,11 @@
 
 #include "gtkdnd-hints.h"
 
+#include "internal.h"
+
 #include <gdk/gdk.h>
 #include <gdk-pixbuf/gdk-pixbuf.h>
 
-#ifdef _WIN32
-#include "win32dep.h"
-#endif
-
 #include "gtk3compat.h"
 
 typedef struct
@@ -179,8 +177,8 @@
 	for (i = 0; hint_windows[i].filename != NULL; i++) {
 		gchar *fname;
 
-		fname = g_build_filename(DATADIR, "pixmaps", "pidgin",
-								 hint_windows[i].filename, NULL);
+		fname = g_build_filename(PURPLE_DATADIR, "pixmaps", "pidgin",
+			hint_windows[i].filename, NULL);
 
 		hint_windows[i].widget = dnd_hints_init_window(fname);
 
--- a/pidgin/gtkdocklet.c	Tue Apr 15 20:01:46 2014 +0530
+++ b/pidgin/gtkdocklet.c	Wed Apr 16 12:04:51 2014 +0530
@@ -1009,7 +1009,8 @@
 		purple_prefs_add_bool(PIDGIN_PREFS_ROOT "/docklet/gtk/embedded", FALSE);
 	}
 
-	tmp = g_build_path(G_DIR_SEPARATOR_S, DATADIR, "pixmaps", "pidgin", "tray", NULL);
+	tmp = g_build_path(G_DIR_SEPARATOR_S, PURPLE_DATADIR,
+		"pixmaps", "pidgin", "tray", NULL);
 	gtk_icon_theme_append_search_path(gtk_icon_theme_get_default(), tmp);
 	g_free(tmp);
 
--- a/pidgin/gtkeventloop.c	Tue Apr 15 20:01:46 2014 +0530
+++ b/pidgin/gtkeventloop.c	Wed Apr 16 12:04:51 2014 +0530
@@ -22,9 +22,7 @@
 #include <glib.h>
 #include "gtkeventloop.h"
 #include "eventloop.h"
-#ifdef _WIN32
-#include "win32dep.h"
-#endif
+#include "internal.h"
 
 #define PIDGIN_READ_COND  (G_IO_IN | G_IO_HUP | G_IO_ERR)
 #define PIDGIN_WRITE_COND (G_IO_OUT | G_IO_HUP | G_IO_ERR | G_IO_NVAL)
--- a/pidgin/gtkprefs.c	Tue Apr 15 20:01:46 2014 +0530
+++ b/pidgin/gtkprefs.c	Wed Apr 16 12:04:51 2014 +0530
@@ -759,7 +759,8 @@
 	/* refresh the list of themes in the manager */
 	purple_theme_manager_refresh();
 
-	tmp = g_build_filename(DATADIR, "icons", "hicolor", "32x32", "apps", "pidgin.png", NULL);
+	tmp = g_build_filename(PURPLE_DATADIR, "icons", "hicolor", "32x32",
+		"apps", "pidgin.png", NULL);
 	pixbuf = pidgin_pixbuf_new_from_file_at_scale(tmp, PREFS_OPTIMAL_ICON_SIZE, PREFS_OPTIMAL_ICON_SIZE, TRUE);
 	g_free(tmp);
 
--- a/pidgin/gtksmiley-theme.c	Tue Apr 15 20:01:46 2014 +0530
+++ b/pidgin/gtksmiley-theme.c	Wed Apr 16 12:04:51 2014 +0530
@@ -536,7 +536,7 @@
 
 	probe_dirs = g_new0(gchar*, 3);
 	probe_dirs[0] = g_build_filename(
-		DATADIR, "pixmaps", "pidgin", "emotes", NULL);
+		PURPLE_DATADIR, "pixmaps", "pidgin", "emotes", NULL);
 	user_smileys_dir = probe_dirs[1] = g_build_filename(
 		purple_user_dir(), "smileys", NULL);
 
--- a/pidgin/gtksound.c	Tue Apr 15 20:01:46 2014 +0530
+++ b/pidgin/gtksound.c	Wed Apr 16 12:04:51 2014 +0530
@@ -630,11 +630,11 @@
 			}
 		}
 
-		if (!filename || !strlen(filename)) {			    /* Use Default sounds */
+		if (!filename || !strlen(filename)) { /* Use Default sounds */
 			g_free(filename);
 
-			/* XXX Consider creating a constant for "sounds/purple" to be shared with Finch */
-			filename = g_build_filename(DATADIR, "sounds", "purple", sounds[event].def, NULL);
+			filename = g_build_filename(PURPLE_DATADIR,
+				"sounds", "purple", sounds[event].def, NULL);
 		}
 
 		purple_sound_play_file(filename, NULL);
--- a/pidgin/gtkutils.c	Tue Apr 15 20:01:46 2014 +0530
+++ b/pidgin/gtkutils.c	Wed Apr 16 12:04:51 2014 +0530
@@ -33,7 +33,7 @@
 #ifdef USE_GTKSPELL
 # include <gtkspell/gtkspell.h>
 # ifdef _WIN32
-#  include "wspell.h"
+#  include "win32/wspell.h"
 # endif
 #endif
 
@@ -629,10 +629,11 @@
 	 */
 	tmp = g_strconcat(protoname, ".png", NULL);
 
-	filename = g_build_filename(DATADIR, "pixmaps", "pidgin", "protocols",
-				    size == PIDGIN_PROTOCOL_ICON_SMALL ? "16" :
-				    size == PIDGIN_PROTOCOL_ICON_MEDIUM ? "22" : "48",
-				    tmp, NULL);
+	filename = g_build_filename(PURPLE_DATADIR,
+		"pixmaps", "pidgin", "protocols",
+		(size == PIDGIN_PROTOCOL_ICON_SMALL) ? "16" :
+			((size == PIDGIN_PROTOCOL_ICON_MEDIUM) ? "22" : "48"),
+		tmp, NULL);
 	g_free(tmp);
 
 	pixbuf = pidgin_pixbuf_new_from_file(filename);
--- a/pidgin/libpidgin.c	Tue Apr 15 20:01:46 2014 +0530
+++ b/pidgin/libpidgin.c	Wed Apr 16 12:04:51 2014 +0530
@@ -223,7 +223,8 @@
 #ifndef _WIN32
 	/* use the nice PNG icon for all the windows */
 	for(i=0; i<G_N_ELEMENTS(icon_sizes); i++) {
-		icon_path = g_build_filename(DATADIR, "icons", "hicolor", icon_sizes[i].dir, "apps", icon_sizes[i].filename, NULL);
+		icon_path = g_build_filename(PURPLE_DATADIR, "icons", "hicolor",
+			icon_sizes[i].dir, "apps", icon_sizes[i].filename, NULL);
 		icon = pidgin_pixbuf_new_from_file(icon_path);
 		g_free(icon_path);
 		if (icon) {
@@ -478,7 +479,7 @@
 #endif
 
 #ifdef ENABLE_NLS
-	bindtextdomain(PACKAGE, LOCALEDIR);
+	bindtextdomain(PACKAGE, PURPLE_LOCALEDIR);
 	bind_textdomain_codeset(PACKAGE, "UTF-8");
 	textdomain(PACKAGE);
 #endif
@@ -757,7 +758,7 @@
 	purple_plugins_add_search_path(search_path);
 	g_free(search_path);
 
-	purple_plugins_add_search_path(LIBDIR);
+	purple_plugins_add_search_path(PIDGIN_LIBDIR);
 	purple_plugins_refresh();
 
 	if (opt_si && !purple_core_ensure_single_instance()) {
--- a/pidgin/pidgin.h	Tue Apr 15 20:01:46 2014 +0530
+++ b/pidgin/pidgin.h	Wed Apr 16 12:04:51 2014 +0530
@@ -32,7 +32,7 @@
 #include <gtk/gtk.h>
 
 #ifdef _WIN32
-# include "gtkwin32dep.h"
+#  include "win32/gtkwin32dep.h"
 #endif
 
 /**
--- a/pidgin/pidginstock.c	Tue Apr 15 20:01:46 2014 +0530
+++ b/pidgin/pidginstock.c	Wed Apr 16 12:04:51 2014 +0530
@@ -238,7 +238,7 @@
 			return filename;
 		g_free(filename);
 	}
-	filename = g_build_filename(DATADIR, name, NULL);
+	filename = g_build_filename(PURPLE_DATADIR, name, NULL);
 	if (g_file_test(filename, G_FILE_TEST_EXISTS))
 		return filename;
 	g_free(filename);
--- a/pidgin/plugins/Makefile.am	Tue Apr 15 20:01:46 2014 +0530
+++ b/pidgin/plugins/Makefile.am	Wed Apr 16 12:04:51 2014 +0530
@@ -113,7 +113,6 @@
 	win32/winprefs/winprefs.c
 
 AM_CPPFLAGS = \
-	-DDATADIR=\"$(datadir)\" \
 	-I$(top_builddir)/libpurple \
 	-I$(top_srcdir)/libpurple \
 	-I$(top_srcdir)/pidgin \
--- a/pidgin/plugins/cap/Makefile.am	Tue Apr 15 20:01:46 2014 +0530
+++ b/pidgin/plugins/cap/Makefile.am	Wed Apr 16 12:04:51 2014 +0530
@@ -18,7 +18,6 @@
 cap_la_LIBADD = $(GTK_LIBS) $(SQLITE3_LIBS)
 
 AM_CPPFLAGS = \
-	-DDATADIR=\"$(datadir)\" \
 	-I$(top_srcdir)/libpurple \
 	-I$(top_builddir)/libpurple \
 	-I$(top_srcdir)/pidgin \
--- a/pidgin/plugins/disco/Makefile.am	Tue Apr 15 20:01:46 2014 +0530
+++ b/pidgin/plugins/disco/Makefile.am	Wed Apr 16 12:04:51 2014 +0530
@@ -20,7 +20,6 @@
 endif
 
 AM_CPPFLAGS = \
-	-DDATADIR=\"$(datadir)\" \
 	-I$(top_srcdir)/libpurple \
 	-I$(top_builddir)/libpurple \
 	-I$(top_srcdir)/pidgin \
--- a/pidgin/plugins/disco/gtkdisco.c	Tue Apr 15 20:01:46 2014 +0530
+++ b/pidgin/plugins/disco/gtkdisco.c	Wed Apr 16 12:04:51 2014 +0530
@@ -120,14 +120,18 @@
 
 	if (service->type == XMPP_DISCO_SERVICE_TYPE_GATEWAY && service->gateway_type) {
 		char *tmp = g_strconcat(service->gateway_type, ".png", NULL);
-		filename = g_build_filename(DATADIR, "pixmaps", "pidgin", "protocols", size, tmp, NULL);
+		filename = g_build_filename(PURPLE_DATADIR,
+			"pixmaps", "pidgin", "protocols", size, tmp, NULL);
 		g_free(tmp);
 #if 0
 	} else if (service->type == XMPP_DISCO_SERVICE_TYPE_USER) {
-		filename = g_build_filename(DATADIR, "pixmaps", "pidgin", "status", size, "person.png", NULL);
+		filename = g_build_filename(PURPLE_DATADIR,
+			"pixmaps", "pidgin", "status", size, "person.png", NULL);
 #endif
-	} else if (service->type == XMPP_DISCO_SERVICE_TYPE_CHAT)
-		filename = g_build_filename(DATADIR, "pixmaps", "pidgin", "status", size, "chat.png", NULL);
+	} else if (service->type == XMPP_DISCO_SERVICE_TYPE_CHAT) {
+		filename = g_build_filename(PURPLE_DATADIR,
+			"pixmaps", "pidgin", "status", size, "chat.png", NULL);
+	}
 
 	if (filename) {
 		pixbuf = gdk_pixbuf_new_from_file(filename, NULL);
--- a/pidgin/plugins/gestures/Makefile.am	Tue Apr 15 20:01:46 2014 +0530
+++ b/pidgin/plugins/gestures/Makefile.am	Wed Apr 16 12:04:51 2014 +0530
@@ -18,7 +18,6 @@
 endif
 
 AM_CPPFLAGS = \
-	-DDATADIR=\"$(datadir)\" \
 	-I$(top_srcdir)/libpurple \
 	-I$(top_builddir)/libpurple \
 	-I$(top_srcdir)/pidgin \
--- a/pidgin/plugins/gevolution/Makefile.am	Tue Apr 15 20:01:46 2014 +0530
+++ b/pidgin/plugins/gevolution/Makefile.am	Wed Apr 16 12:04:51 2014 +0530
@@ -20,7 +20,6 @@
 endif
 
 AM_CPPFLAGS = \
-	-DDATADIR=\"$(datadir)\" \
 	-I$(top_srcdir)/libpurple \
 	-I$(top_builddir)/libpurple \
 	-I$(top_srcdir)/pidgin \
--- a/pidgin/plugins/musicmessaging/Makefile.am	Tue Apr 15 20:01:46 2014 +0530
+++ b/pidgin/plugins/musicmessaging/Makefile.am	Wed Apr 16 12:04:51 2014 +0530
@@ -35,7 +35,6 @@
 endif
 
 AM_CPPFLAGS = \
-	-DDATADIR=\"$(datadir)\" \
 	-I$(top_builddir)/libpurple \
 	-I$(top_srcdir)/libpurple \
 	-I$(top_srcdir)/pidgin \
--- a/pidgin/plugins/musicmessaging/musicmessaging.c	Tue Apr 15 20:01:46 2014 +0530
+++ b/pidgin/plugins/musicmessaging/musicmessaging.c	Wed Apr 16 12:04:51 2014 +0530
@@ -85,10 +85,20 @@
 #define DBUS_INTERFACE_GSCORE "org.gscore.GScoreInterface"
 
 /* Define the functions to export for use with DBus */
-DBUS_EXPORT void music_messaging_change_request (const int session, const char *command, const char *parameters);
-DBUS_EXPORT void music_messaging_change_confirmed (const int session, const char *command, const char *parameters);
-DBUS_EXPORT void music_messaging_change_failed (const int session, const char *id, const char *command, const char *parameters);
-DBUS_EXPORT void music_messaging_done_session (const int session);
+DBUS_EXPORT void
+music_messaging_change_request(const int session, const char *command,
+	const char *parameters);
+
+DBUS_EXPORT void
+music_messaging_change_confirmed(const int session, const char *command,
+	const char *parameters);
+
+DBUS_EXPORT void
+music_messaging_change_failed(const int session, const char *id,
+	const char *command, const char *parameters);
+
+DBUS_EXPORT void
+music_messaging_done_session(const int session);
 
 /* This file has been generated by the #dbus-analize-functions.py
    script.  It contains dbus wrappers for the four functions declared
@@ -96,7 +106,9 @@
 #include "music-messaging-bindings.c"
 
 /* Exported functions */
-void music_messaging_change_request(const int session, const char *command, const char *parameters)
+DBUS_EXPORT void
+music_messaging_change_request(const int session, const char *command,
+	const char *parameters)
 {
 
 	MMConversation *mmconv = (MMConversation *)g_list_nth_data(conversations, session);
@@ -120,7 +132,9 @@
 
 }
 
-void music_messaging_change_confirmed(const int session, const char *command, const char *parameters)
+DBUS_EXPORT void
+music_messaging_change_confirmed(const int session, const char *command,
+	const char *parameters)
 {
 
 	MMConversation *mmconv = (MMConversation *)g_list_nth_data(conversations, session);
@@ -141,7 +155,9 @@
 
 }
 
-void music_messaging_change_failed(const int session, const char *id, const char *command, const char *parameters)
+DBUS_EXPORT void
+music_messaging_change_failed(const int session, const char *id,
+	const char *command, const char *parameters)
 {
 	MMConversation *mmconv = (MMConversation *)g_list_nth_data(conversations, session);
 
@@ -163,7 +179,8 @@
 	}
 }
 
-void music_messaging_done_session(const int session)
+DBUS_EXPORT void
+music_messaging_done_session(const int session)
 {
 	MMConversation *mmconv = (MMConversation *)g_list_nth_data(conversations, session);
 
@@ -500,11 +517,16 @@
 
 static void kill_editor (MMConversation *mmconv)
 {
+#ifdef HAVE_SIGNAL_H
 	if (mmconv->pid)
 	{
 		kill(mmconv->pid, SIGINT);
 		mmconv->pid = 0;
 	}
+#else
+	purple_debug_warning("musicmessaging",
+		"kill() is not supported on this platform");
+#endif
 }
 
 static void init_conversation (PurpleConversation *conv)
@@ -549,8 +571,8 @@
 
 	g_signal_connect(G_OBJECT(button), "toggled", G_CALLBACK(music_button_toggled), mmconv);
 
-	file_path = g_build_filename(DATADIR, "pixmaps", "purple", "buttons",
-										"music.png", NULL);
+	file_path = g_build_filename(PURPLE_DATADIR,
+		"pixmaps", "purple", "buttons", "music.png", NULL);
 	image = gtk_image_new_from_file(file_path);
 	g_free(file_path);
 
--- a/pidgin/plugins/ticker/Makefile.am	Tue Apr 15 20:01:46 2014 +0530
+++ b/pidgin/plugins/ticker/Makefile.am	Wed Apr 16 12:04:51 2014 +0530
@@ -19,7 +19,6 @@
 endif
 
 AM_CPPFLAGS = \
-	-DDATADIR=\"$(datadir)\" \
 	-I$(top_srcdir)/libpurple \
 	-I$(top_builddir)/libpurple \
 	-I$(top_srcdir)/pidgin \
--- a/pidgin/win32/gtkwin32dep.c	Tue Apr 15 20:01:46 2014 +0530
+++ b/pidgin/win32/gtkwin32dep.c	Wed Apr 16 12:04:51 2014 +0530
@@ -47,7 +47,6 @@
 #include "untar.h"
 
 #include "gtkwin32dep.h"
-#include "win32dep.h"
 #include "gtkconv.h"
 #include "gtkconn.h"
 #include "util.h"
--- a/pidgin/win32/wspell.c	Tue Apr 15 20:01:46 2014 +0530
+++ b/pidgin/win32/wspell.c	Wed Apr 16 12:04:51 2014 +0530
@@ -33,7 +33,7 @@
 #include <gtk/gtk.h>
 #include <gtkspell/gtkspell.h>
 #include "debug.h"
-#include "win32dep.h"
+#include "internal.h"
 #include "wspell.h"
 
 /* Intermediate function so that we can eat Enchant error popups when it doesn't find a DLL

mercurial