/soc/2013/ankitkv/gobjectification: 27cf01a05bdf: Merged default...

Ankit Vani a at nevitus.org
Sat Apr 19 10:36:15 EDT 2014


Changeset: 27cf01a05bdfcf1b2c3a9e9c133955943f511ca9
Author:	 Ankit Vani <a at nevitus.org>
Date:	 2014-04-19 20:05 +0530
Branch:	 soc.2013.gobjectification.plugins
URL: https://hg.pidgin.im/soc/2013/ankitkv/gobjectification/rev/27cf01a05bdf

Description:

Merged default branch

diffstat:

 .hgignore                                      |   1 +
 config.h.mingw                                 |   7 ++
 configure.ac                                   |  47 ++++++++++++++-
 finch/Makefile.am                              |   7 +-
 finch/libgnt/wms/Makefile.am                   |   4 +-
 finch/plugins/Makefile.am                      |  26 ++++----
 libpurple/Makefile.am                          |  14 +++-
 libpurple/glibcompat.h                         |  17 +++++
 libpurple/plugins/Makefile.am                  |  78 +++++++++++++-------------
 libpurple/plugins/keyrings/Makefile.am         |  30 +++++++--
 libpurple/plugins/mono/loader/Makefile.am      |   2 +-
 libpurple/plugins/ssl/Makefile.am              |  12 ++--
 libpurple/plugins/tcl/Makefile.am              |   4 +-
 libpurple/protocols/bonjour/Makefile.am        |   6 +-
 libpurple/protocols/gg/Makefile.am             |   6 +-
 libpurple/protocols/gg/lib/config.h            |   2 +-
 libpurple/protocols/irc/Makefile.am            |   4 +-
 libpurple/protocols/jabber/Makefile.am         |   4 +-
 libpurple/protocols/msn/Makefile.am            |   4 +-
 libpurple/protocols/mxit/Makefile.am           |   4 +-
 libpurple/protocols/novell/Makefile.am         |   4 +-
 libpurple/protocols/null/Makefile.am           |   4 +-
 libpurple/protocols/oscar/Makefile.am          |   4 +-
 libpurple/protocols/sametime/Makefile.am       |   4 +-
 libpurple/protocols/silc/Makefile.am           |   6 +-
 libpurple/protocols/simple/Makefile.am         |   4 +-
 libpurple/protocols/yahoo/Makefile.am          |   4 +-
 libpurple/protocols/zephyr/Makefile.am         |   8 +-
 libpurple/util.c                               |  17 +++--
 libpurple/win32/libc_interface.h               |  11 ++-
 libpurple/win32/libpurplerc.rc.in              |   6 +-
 libpurple/win32/win32dep.c                     |   2 +-
 libpurple/win32/win32dep.h                     |   2 +-
 pidgin/Makefile.am                             |  22 ++++---
 pidgin/Makefile.mingw                          |   5 +-
 pidgin/gtkblist.c                              |  11 ++-
 pidgin/gtkeventloop.c                          |   2 +-
 pidgin/plugins/Makefile.am                     |  70 ++++++++++++----------
 pidgin/plugins/cap/Makefile.am                 |   4 +-
 pidgin/plugins/cap/cap.c                       |  52 +++++++---------
 pidgin/plugins/crazychat/Makefile.am           |   5 +-
 pidgin/plugins/disco/Makefile.am               |   4 +-
 pidgin/plugins/gestures/Makefile.am            |   4 +-
 pidgin/plugins/gevolution/Makefile.am          |   4 +-
 pidgin/plugins/musicmessaging/Makefile.am      |   4 +-
 pidgin/plugins/ticker/Makefile.am              |   4 +-
 pidgin/plugins/win32/transparency/Makefile.am  |  16 +++++
 pidgin/plugins/win32/transparency/win2ktrans.c |   3 +-
 pidgin/plugins/win32/winprefs/Makefile.am      |  19 ++++++
 pidgin/plugins/win32/winprefs/winprefs.c       |   2 +-
 pidgin/win32/gtkwin32dep.c                     |  15 +++--
 pidgin/win32/pidgin_dll_rc.rc.in               |   8 +-
 pidgin/win32/pidgin_exe_rc.rc.in               |   8 +-
 pidgin/win32/untar.c                           |   6 +-
 pidgin/win32/winpidgin.c                       |  10 +++
 55 files changed, 389 insertions(+), 244 deletions(-)

diffs (truncated from 1746 to 300 lines):

diff --git a/.hgignore b/.hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -2,6 +2,7 @@ syntax: glob
 .*.swp
 clang_output_*
 pidgin-*
+.dirstamp
 
 syntax: regexp
 (.*/)?TAGS$
diff --git a/config.h.mingw b/config.h.mingw
--- a/config.h.mingw
+++ b/config.h.mingw
@@ -406,6 +406,13 @@
  */
 #define HAVE_VSNPRINTF 1
 
+#define FINCH_LIBDIR wpurple_lib_dir()
+#define PIDGIN_LIBDIR wpurple_lib_dir()
+#define PURPLE_DATADIR wpurple_install_dir()
+#define PURPLE_LIBDIR wpurple_lib_dir()
+#define PURPLE_LOCALEDIR wpurple_locale_dir()
+#define PURPLE_SYSCONFDIR wpurple_sysconf_dir()
+
 #define HAVE_FILENO 1
 
 #ifndef _WIN32_WINNT
diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -114,7 +114,6 @@ AM_PROG_CC_C_O
 AC_PROG_CXX
 LT_PREREQ([2.2.6])
 LT_INIT([disable-static])
-LIBTOOL="$LIBTOOL --silent"
 AC_PROG_INSTALL
 PKG_PROG_PKG_CONFIG
 AC_FUNC_ALLOCA
@@ -128,14 +127,31 @@ case "$host" in
 		is_win32="yes"
 		LIBS="$LIBS -lws2_32"
 		DNSAPI_LIBS="-ldnsapi"
+		PLUGIN_LDFLAGS="-avoid-version -no-undefined"
 		AC_SUBST(DNSAPI_LIBS)
+		AC_CHECK_TOOL(WINDRES, windres)
+		AC_DEFINE(IS_WIN32_CROSS_COMPILED, 1,
+			[Define to 1, when building with autotools (not necessarily
+			cross-compiling) for windows. It's a temporary hack to remain
+			non-autotools win32 build working. Drop it when we fully
+			switch our win32 build to autotools.])
 		;;
 	*)
 		is_win32="no"
+		PLUGIN_LDFLAGS="-avoid-version"
 		AC_CHECK_HEADERS(signal.h)
 		;;
 esac
 AM_CONDITIONAL(IS_WIN32, test "x$is_win32" = "xyes")
+AC_SUBST([PLUGIN_LDFLAGS])
+
+dnl Define *_LIBS
+PURPLE_LIBS="\$(top_builddir)/libpurple/libpurple.la \$(GLIB_LIBS)"
+PIDGIN_LIBS="\$(top_builddir)/pidgin/libpidgin.la \$(GTK_LIBS)"
+FINCH_LIBS="\$(top_builddir)/finch/libfinch.la \$(top_builddir)/finch/libgnt/libgnt.la \$(GLIB_LIBS)"
+AC_SUBST(PURPLE_LIBS)
+AC_SUBST(PIDGIN_LIBS)
+AC_SUBST(FINCH_LIBS)
 
 dnl Checks for header files.
 AC_HEADER_STDC
@@ -153,7 +169,7 @@ AC_C_BIGENDIAN
 
 dnl Check for directories
 if test "x$is_win32" = "xyes" ; then
-	purple_datadir="wpurple_data_dir()"
+	purple_datadir="wpurple_install_dir()"
 	purple_libdir="wpurple_lib_dir()"
 	pidgin_libdir="wpurple_lib_dir()"
 	finch_libdir="wpurple_lib_dir()"
@@ -231,7 +247,11 @@ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 ], [
 	AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[
 		#include <sys/types.h>
-		#include <sys/socket.h>
+		#ifdef _WIN32
+		#  include <ws2tcpip.h>
+		#else
+		#  include <sys/socket.h>
+		#endif
 		int accept(int, struct sockaddr *, size_t *);
 	]], [[]])], [
 		AC_MSG_RESULT(size_t)
@@ -246,13 +266,25 @@ dnl Some systems do not have sa_len fiel
 AC_CHECK_MEMBER([struct sockaddr.sa_len],
 	[AC_DEFINE([HAVE_STRUCT_SOCKADDR_SA_LEN],[1],
 	[Define if struct sockaddr has an sa_len member])],[:],
-	[#include <sys/socket.h>])
+	[
+		#ifdef _WIN32
+		#  include <ws2tcpip.h>
+		#else
+		#  include <sys/socket.h>
+		#endif
+	])
 
 dnl Check for v6-only sockets
 AC_CHECK_DECL([IPV6_V6ONLY],
 	[AC_DEFINE([HAVE_IPV6_V6ONLY],[1],
 	[Define if the IPV6_V6ONLY setsockopt option exists])],
-	[], [#include <netinet/in.h>])
+	[], [
+		#ifdef _WIN32
+		#  include <ws2tcpip.h>
+		#else
+		#  include <netinet/in.h>
+		#endif
+	])
 
 dnl to prevent the g_stat()/g_unlink() crash,
 dnl (09:50:07) Robot101: LSchiere2: it's easy. +LC_SYS_LARGEFILE somewhere in configure.ac
@@ -2679,7 +2711,11 @@ AC_CONFIG_FILES([Makefile
 		   pidgin/plugins/gevolution/Makefile
 		   pidgin/plugins/musicmessaging/Makefile
 		   pidgin/plugins/ticker/Makefile
+		   pidgin/plugins/win32/transparency/Makefile
+		   pidgin/plugins/win32/winprefs/Makefile
 		   pidgin/themes/Makefile
+		   pidgin/win32/pidgin_dll_rc.rc
+		   pidgin/win32/pidgin_exe_rc.rc
 		   libpurple/example/Makefile
 		   libpurple/gconf/Makefile
 		   libpurple/purple-3.pc
@@ -2706,6 +2742,7 @@ AC_CONFIG_FILES([Makefile
 		   libpurple/tests/Makefile
 		   libpurple/purple.h
 		   libpurple/version.h
+		   libpurple/win32/libpurplerc.rc
 		   share/sounds/Makefile
 		   share/ca-certs/Makefile
 		   finch/finch.pc
diff --git a/finch/Makefile.am b/finch/Makefile.am
--- a/finch/Makefile.am
+++ b/finch/Makefile.am
@@ -7,11 +7,12 @@ EXTRA_DIST = \
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = finch.pc
 
-SUBDIRS = libgnt plugins
+SUBDIRS = libgnt . plugins
 
 if ENABLE_GNT
 
-noinst_LTLIBRARIES = libfinch.la
+# XXX: should this be lib_, or noinst_?
+lib_LTLIBRARIES = libfinch.la
 bin_PROGRAMS = finch
 
 endif
@@ -70,7 +71,7 @@ libfinchinclude_HEADERS = \
 	$(libfinch_la_headers)
 
 libfinch_la_DEPENDENCIES = @LIBOBJS@
-libfinch_la_LDFLAGS = -export-dynamic
+libfinch_la_LDFLAGS = -export-dynamic -no-undefined
 libfinch_la_LIBADD = \
 	@LIBOBJS@ \
 	$(DBUS_LIBS) \
diff --git a/finch/libgnt/wms/Makefile.am b/finch/libgnt/wms/Makefile.am
--- a/finch/libgnt/wms/Makefile.am
+++ b/finch/libgnt/wms/Makefile.am
@@ -6,8 +6,8 @@ else
 purple_wms =
 endif
 
-s_la_LDFLAGS             = -module -avoid-version
-irssi_la_LDFLAGS         = -module -avoid-version
+s_la_LDFLAGS     = -module @PLUGIN_LDFLAGS@
+irssi_la_LDFLAGS = -module @PLUGIN_LDFLAGS@
 
 plugin_LTLIBRARIES = \
 	$(wms) \
diff --git a/finch/plugins/Makefile.am b/finch/plugins/Makefile.am
--- a/finch/plugins/Makefile.am
+++ b/finch/plugins/Makefile.am
@@ -1,9 +1,9 @@
-gntclipboard_la_LDFLAGS = -module -avoid-version
-gntgf_la_LDFLAGS      = -module -avoid-version
-gnthistory_la_LDFLAGS = -module -avoid-version
-gntlastlog_la_LDFLAGS = -module -avoid-version
-gnttinyurl_la_LDFLAGS = -module -avoid-version
-grouping_la_LDFLAGS   = -module -avoid-version
+gntclipboard_la_LDFLAGS = -module @PLUGIN_LDFLAGS@
+gntgf_la_LDFLAGS        = -module @PLUGIN_LDFLAGS@
+gnthistory_la_LDFLAGS   = -module @PLUGIN_LDFLAGS@
+gntlastlog_la_LDFLAGS   = -module @PLUGIN_LDFLAGS@
+gnttinyurl_la_LDFLAGS   = -module @PLUGIN_LDFLAGS@
+grouping_la_LDFLAGS     = -module @PLUGIN_LDFLAGS@
 
 if PLUGINS
 
@@ -27,12 +27,12 @@ grouping_la_SOURCES   = grouping.c
 gntclipboard_la_CFLAGS = $(X11_CFLAGS)
 gntgf_la_CFLAGS = $(X11_CFLAGS)
 
-gntclipboard_la_LIBADD = $(GLIB_LIBS) $(X11_LIBS)
-gntgf_la_LIBADD       = $(GLIB_LIBS) $(X11_LIBS) $(top_builddir)/finch/libgnt/libgnt.la
-gnthistory_la_LIBADD  = $(GLIB_LIBS)
-gntlastlog_la_LIBADD  = $(GLIB_LIBS)
-gnttinyurl_la_LIBADD  = $(GLIB_LIBS)
-grouping_la_LIBADD    = $(GLIB_LIBS) $(top_builddir)/finch/libgnt/libgnt.la
+gntclipboard_la_LIBADD = @FINCH_LIBS@ $(X11_LIBS)
+gntgf_la_LIBADD        = @FINCH_LIBS@ $(X11_LIBS)
+gnthistory_la_LIBADD   = @FINCH_LIBS@
+gntlastlog_la_LIBADD   = @FINCH_LIBS@
+gnttinyurl_la_LIBADD   = @FINCH_LIBS@
+grouping_la_LIBADD     = @FINCH_LIBS@
 
 endif # PLUGINS
 
@@ -57,7 +57,7 @@ AM_CPPFLAGS = \
 SUFFIXES = .c .so
 .c.so:
 	$(LIBTOOL) --mode=compile $(CC) -DHAVE_CONFIG_H -I$(top_builddir) $(AM_CPPFLAGS) $(CFLAGS) -c $< -o tmp$@.lo $(PLUGIN_CFLAGS)
-	$(LIBTOOL) --mode=link    $(CC) $(CFLAGS) -o libtmp$@.la -rpath $(plugindir) tmp$@.lo $(LIBS) $(LDFLAGS) -module -avoid-version $(PLUGIN_LIBS)
+	$(LIBTOOL) --mode=link    $(CC) $(CFLAGS) -o libtmp$@.la -rpath $(plugindir) tmp$@.lo $(LIBS) $(LDFLAGS) -module @PLUGIN_LDFLAGS@ $(PLUGIN_LIBS)
 	@rm -f tmp$@.lo tmp$@.o libtmp$@.la
 	@cp .libs/libtmp$@.so.so $@
 	@rm -rf .libs/libtmp$@.*
diff --git a/libpurple/Makefile.am b/libpurple/Makefile.am
--- a/libpurple/Makefile.am
+++ b/libpurple/Makefile.am
@@ -36,7 +36,7 @@ endif
 pkgconfigdir = $(libdir)/pkgconfig
 pkgconfig_DATA = purple-3.pc
 
-SUBDIRS = $(GCONF_DIR) plugins protocols . tests example
+SUBDIRS = $(GCONF_DIR) . plugins protocols tests example
 
 purple_coresources = \
 	account.c \
@@ -213,11 +213,18 @@ 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
+
+.rc.o: %.rc
+	$(AM_V_GEN)$(WINDRES) -I$(top_srcdir)/libpurple -i $< -o $@
+
+LIBPURPLE_WIN32RES = win32/libpurplerc.o
+LIBPURPLE_WIN32RES_LDFLAGS = -Wl,$(LIBPURPLE_WIN32RES)
 endif
 
 purple_mediaheaders = \
@@ -400,9 +407,10 @@ mediainclude_HEADERS = \
 	$(addprefix $(srcdir)/media/, $(purple_mediaheaders))
 
 libpurple_la_DEPENDENCIES = \
-	$(STATIC_LINK_LIBS)
+	$(STATIC_LINK_LIBS) $(LIBPURPLE_WIN32RES)
 
-libpurple_la_LDFLAGS = -export-dynamic -version-info $(PURPLE_LT_VERSION_INFO) -no-undefined
+libpurple_la_LDFLAGS = -export-dynamic -version-info $(PURPLE_LT_VERSION_INFO) \
+	-no-undefined $(LIBPURPLE_WIN32RES_LDFLAGS)
 libpurple_la_LIBADD = \
 	$(STATIC_LINK_LIBS) \
 	$(DBUS_LIBS) \
diff --git a/libpurple/glibcompat.h b/libpurple/glibcompat.h
--- a/libpurple/glibcompat.h
+++ b/libpurple/glibcompat.h
@@ -148,6 +148,23 @@ static inline void g_object_class_instal
 #endif /* < 2.36.0 */
 
 
+/* glib's definition of g_stat+GStatBuf seems to be broken on mingw64-w32 (and
+ * possibly other 32-bit windows), so instead of relying on it,
+ * we'll define our own.
+ */
+#if defined(_WIN32) && !defined(_MSC_VER) && !defined(_WIN64)
+#  include <glib/gstdio.h>
+typedef struct _stat GStatBufW32;
+static inline int
+purple_g_stat(const gchar *filename, GStatBufW32 *buf)
+{
+	return g_stat(filename, (GStatBuf*)buf);
+}
+#  define GStatBuf GStatBufW32
+#  define g_stat purple_g_stat
+#endif
+
+
 #ifdef __clang__
 
 #undef G_GNUC_BEGIN_IGNORE_DEPRECATIONS



More information about the Commits mailing list