/pidgin/main: 3d157ce203ed: cross-win32: make libpidgin and libf...

Tomasz Wasilczyk twasilczyk at pidgin.im
Wed Apr 16 16:40:54 EDT 2014


Changeset: 3d157ce203edb69f82bf53a4c8e517fbb8e5f811
Author:	 Tomasz Wasilczyk <twasilczyk at pidgin.im>
Date:	 2014-04-16 22:40 +0200
Branch:	 default
URL: https://hg.pidgin.im/pidgin/main/rev/3d157ce203ed

Description:

cross-win32: make libpidgin and libfinch shared, disable hacky libpidgin loading code. Pidgin runs now

diffstat:

 configure.ac             |   5 +++++
 finch/Makefile.am        |   5 +++--
 pidgin/Makefile.am       |   5 +++--
 pidgin/gtkeventloop.c    |   2 +-
 pidgin/win32/winpidgin.c |  10 ++++++++++
 5 files changed, 22 insertions(+), 5 deletions(-)

diffs (123 lines):

diff --git a/configure.ac b/configure.ac
--- a/configure.ac
+++ b/configure.ac
@@ -128,6 +128,11 @@ case "$host" in
 		LIBS="$LIBS -lws2_32"
 		DNSAPI_LIBS="-ldnsapi"
 		AC_SUBST(DNSAPI_LIBS)
+		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"
diff --git a/finch/Makefile.am b/finch/Makefile.am
--- a/finch/Makefile.am
+++ b/finch/Makefile.am
@@ -11,7 +11,8 @@ 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/pidgin/Makefile.am b/pidgin/Makefile.am
--- a/pidgin/Makefile.am
+++ b/pidgin/Makefile.am
@@ -38,7 +38,8 @@ pkgconfig_DATA = pidgin-3.pc
 
 SUBDIRS = pixmaps plugins themes
 
-noinst_LTLIBRARIES = libpidgin.la
+# XXX: should this be lib_, or noinst_?
+lib_LTLIBRARIES = libpidgin.la
 bin_PROGRAMS = pidgin
 
 libpidgin_la_SOURCES = \
@@ -187,7 +188,7 @@ CLEANFILES = gtkdebug.html.h
 gtkdebug.c: gtkdebug.html.h
 
 libpidgin_la_DEPENDENCIES = @LIBOBJS@
-libpidgin_la_LDFLAGS = -export-dynamic
+libpidgin_la_LDFLAGS = -export-dynamic -no-undefined
 libpidgin_la_LIBADD = \
 	@LIBOBJS@ \
 	$(GLIB_LIBS) \
diff --git a/pidgin/gtkeventloop.c b/pidgin/gtkeventloop.c
--- a/pidgin/gtkeventloop.c
+++ b/pidgin/gtkeventloop.c
@@ -52,7 +52,7 @@ static gboolean pidgin_io_invoke(GIOChan
 
 #ifdef _WIN32
 	if(! purple_cond) {
-#ifdef DEBUG
+#if 0
 		purple_debug_misc("gtk_eventloop",
 			   "CLOSURE received GIOCondition of 0x%x, which does not"
 			   " match 0x%x (READ) or 0x%x (WRITE)\n",
diff --git a/pidgin/win32/winpidgin.c b/pidgin/win32/winpidgin.c
--- a/pidgin/win32/winpidgin.c
+++ b/pidgin/win32/winpidgin.c
@@ -35,7 +35,9 @@
 #include <sys/types.h>
 #include <sys/stat.h>
 
+#ifndef IS_WIN32_CROSS_COMPILED
 typedef int (__cdecl* LPFNPIDGINMAIN)(HINSTANCE, int, char**);
+#endif
 typedef void (WINAPI* LPFNSETDLLDIRECTORY)(LPCWSTR);
 typedef BOOL (WINAPI* LPFNATTACHCONSOLE)(DWORD);
 typedef BOOL (WINAPI* LPFNSETPROCESSDEPPOLICY)(DWORD);
@@ -45,7 +47,11 @@ static BOOL portable_mode = FALSE;
 /*
  *  PROTOTYPES
  */
+#ifdef IS_WIN32_CROSS_COMPILED
+int __cdecl pidgin_main(HINSTANCE hint, int argc, char *argv[]);
+#else
 static LPFNPIDGINMAIN pidgin_main = NULL;
+#endif
 static LPFNSETDLLDIRECTORY MySetDllDirectory = NULL;
 
 static const wchar_t *get_win32_error_message(DWORD err) {
@@ -871,15 +877,18 @@ WinMain (struct HINSTANCE__ *hInstance, 
 		if (!winpidgin_set_running(getenv("PIDGIN_MULTI_INST") == NULL && !multiple))
 			return 0;
 
+#ifndef IS_WIN32_CROSS_COMPILED
 	/* Now we are ready for Pidgin .. */
 	wcscat(pidgin_dir, L"\\pidgin.dll");
 	if ((hmod = LoadLibraryW(pidgin_dir)))
 		pidgin_main = (LPFNPIDGINMAIN) GetProcAddress(hmod, "pidgin_main");
+#endif
 
 	/* Restore pidgin_dir to point to where the executable is */
 	if (pidgin_dir_start)
 		pidgin_dir_start[0] = L'\0';
 
+#ifndef IS_WIN32_CROSS_COMPILED
 	if (!pidgin_main) {
 		DWORD dw = GetLastError();
 		BOOL mod_not_found = (dw == ERROR_MOD_NOT_FOUND || dw == ERROR_DLL_NOT_FOUND);
@@ -894,6 +903,7 @@ WinMain (struct HINSTANCE__ *hInstance, 
 
 		return 0;
 	}
+#endif
 
 	/* Convert argv to utf-8*/
 	szArglist = CommandLineToArgvW(cmdLine, &j);



More information about the Commits mailing list