Index: scintilla/ScintillaGTK.cxx
===================================================================
--- scintilla/ScintillaGTK.cxx	(revision 2266)
+++ scintilla/ScintillaGTK.cxx	(working copy)
@@ -15,7 +15,7 @@
 #include "Platform.h"
 
 #if PLAT_GTK_WIN32
-#include "Windows.h"
+#include "windows.h"
 #endif
 
 #include "Scintilla.h"
Index: src/main.c
===================================================================
--- src/main.c	(revision 2266)
+++ src/main.c	(working copy)
@@ -523,10 +523,18 @@
 
 	if (print_prefix)
 	{
+#ifdef GEANY_PREFIX
 		printf("%s\n", GEANY_PREFIX);
+#endif
+#ifdef GEANY_DATADIR
 		printf("%s\n", GEANY_DATADIR);
+#endif
+#ifdef GEANY_LIBDIR
 		printf("%s\n", GEANY_LIBDIR);
+#endif
+#ifdef GEANY_LOCALEDIR
 		printf("%s\n", GEANY_LOCALEDIR);
+#endif
 		exit(0);
 	}
 
Index: src/Makefile.am
===================================================================
--- src/Makefile.am	(revision 2266)
+++ src/Makefile.am	(working copy)
@@ -49,7 +49,8 @@
 
 if MINGW
 # build Geany for Windows on non-Windows systems (cross-compile)
-WINDRES = /usr/local/cross-tools/bin/i386-mingw32msvc-windres
+#WINDRES = /usr/local/cross-tools/bin/i386-mingw32msvc-windres
+WINDRES = $(host)-windres
 
 geany_SOURCES = $(SRCS) win32.c win32.h
 geany_LDADD = ../scintilla/libscintilla.a ../tagmanager/libtagmanager.a -lstdc++ @GTK_LIBS@ \
@@ -61,7 +62,8 @@
 INCLUDES = -I$(srcdir)/../scintilla/include -I$(srcdir)/../tagmanager/include -DENABLE_NLS \
            -I/usr/local/cross-tools/include @GTK_CFLAGS@
 
-geany_windres.res:
+#geany_windres.res:
+geany_private.res:
 	$(WINDRES) -i ../geany_private.rc --input-format=rc -o geany_private.res -O coff;
 
 clean-local:
Index: tagmanager/tm_file_entry.c
===================================================================
--- tagmanager/tm_file_entry.c	(revision 2266)
+++ tagmanager/tm_file_entry.c	(working copy)
@@ -78,6 +78,18 @@
 		return tm_file_unknown_t;
 }
 
+static boolean fileNameMatched (
+		const char* const pattern, const char* const fileName)
+{
+#if defined (HAVE_FNMATCH)
+	return (boolean) (fnmatch (pattern, fileName, 0) == 0);
+#elif defined (CASE_INSENSITIVE_FILENAMES)
+	return (boolean) (strcasecmp (pattern, fileName) == 0);
+#else
+	return (boolean) (strcmp (pattern, fileName) == 0);
+#endif
+}
+
 static gboolean apply_filter(const char *name, GList *match, GList *unmatch
   , gboolean ignore_hidden)
 {
@@ -91,7 +103,7 @@
 		return FALSE;
 	for (tmp = match; tmp; tmp = g_list_next(tmp))
 	{
-		if (0 == fnmatch((char *) tmp->data, name, 0))
+		if (fileNameMatched((char *) tmp->data, name))
 		{
 			matched = TRUE;
 			break;
@@ -101,7 +113,7 @@
 		return FALSE;
 	for (tmp = unmatch; tmp; tmp = g_list_next(tmp))
 	{
-		if (0 == fnmatch((char *) tmp->data, name, 0))
+		if (fileNameMatched((char *) tmp->data, name))
 		{
 			return FALSE;
 		}
Index: tagmanager/tm_project.c
===================================================================
--- tagmanager/tm_project.c	(revision 2266)
+++ tagmanager/tm_project.c	(working copy)
@@ -550,6 +550,18 @@
 	}
 }
 
+static boolean fileNameMatched (
+		const char* const pattern, const char* const fileName)
+{
+#if defined (HAVE_FNMATCH)
+	return (boolean) (fnmatch (pattern, fileName, 0) == 0);
+#elif defined (CASE_INSENSITIVE_FILENAMES)
+	return (boolean) (strcasecmp (pattern, fileName) == 0);
+#else
+	return (boolean) (strcmp (pattern, fileName) == 0);
+#endif
+}
+
 gboolean tm_project_is_source_file(TMProject *project, const char *file_name)
 {
 	const char **pr_extn;
@@ -559,7 +571,7 @@
 		return FALSE;
 	for (pr_extn = project->sources; pr_extn && *pr_extn; ++ pr_extn)
 	{
-		if (0 == fnmatch(*pr_extn, file_name, 0))
+		if (fileNameMatched(*pr_extn, file_name))
 			return TRUE;
 	}
 	return FALSE;
Index: configure.in
===================================================================
--- configure.in	(revision 2266)
+++ configure.in	(working copy)
@@ -117,28 +117,6 @@
 AC_ARG_ENABLE(deprecated, [  --disable-deprecated    Disable deprecated GTK functions. ],
 			  [GTK_CFLAGS="$GTK_CFLAGS -DG_DISABLE_DEPRECATED -DGTK_DISABLE_DEPRECATED"], [])
 
-# socket support
-AC_ARG_ENABLE(socket, AC_HELP_STRING([--enable-socket],[enable if you want to detect a running instance [[default=yes]]]),
- [want_socket="$enableval"], [want_socket="yes"])
-
-if test "x$want_socket" = "xyes"; then
-	AC_DEFINE(HAVE_SOCKET, 1, [Define if you want to detect a running instance])
-	# this should bring in libsocket on Solaris:
-	AC_SEARCH_LIBS([connect],[socket],[],[],[])
-fi
-
-# VTE support
-AC_ARG_ENABLE(vte, AC_HELP_STRING([--enable-vte],
- [enable if you want virtual termninal support [[default=yes]]]),
- [want_vte="$enableval"], [want_vte="yes"])
-if test "x$want_vte" = "xyes"; then
-	AC_DEFINE(HAVE_VTE, 1, [Define if you want VTE support])
-fi
-AC_ARG_WITH(vte-module-path, AC_HELP_STRING([--with-vte-module-path=PATH],
- [Path to a loadable libvte [[default=None]]]), [AC_DEFINE_UNQUOTED([VTE_MODULE_PATH],
- ["$withval"], [Path to a loadable libvte])])
-
-
 # Plugins support
 AC_ARG_ENABLE(plugins, [AC_HELP_STRING([--disable-plugins], [compile without plugin support  [[default=no]]])], , enable_plugins=yes)
 
@@ -155,13 +133,45 @@
 	AC_CHECK_FILE([/dev/random], AC_DEFINE([HAVE_DEVRANDOM], [1], [Define that you found /dev/random]))
 fi
 
-if test "x$host" = "xi386-mingw32msvc"; then
+case "${host}" in
+    *mingw*)
 	AC_DEFINE_UNQUOTED([WIN32], 1, [we are cross compiling for WIN32])
 	want_vte="no"
+	want_socket="no"
 	AC_EXEEXT
+	AM_CONDITIONAL(MINGW, true)  
+	;;
+    *)
+        AM_CONDITIONAL(MINGW, false)
+	;;
+esac
+
+dnl skip check if already decided
+if test "x$want_socket" = "x"; then
+    # socket support
+    AC_ARG_ENABLE(socket, AC_HELP_STRING([--enable-socket],[enable if you want to detect a running instance [[default=yes]]]),
+     [want_socket="$enableval"], [want_socket="yes"])
+
+    if test "x$want_socket" = "xyes"; then
+    	AC_DEFINE(HAVE_SOCKET, 1, [Define if you want to detect a running instance])
+	# this should bring in libsocket on Solaris:
+	AC_SEARCH_LIBS([connect],[socket],[],[],[])
+    fi
 fi
-AM_CONDITIONAL(MINGW, test "x$host" = "xi386-mingw32msvc")
 
+dnl skip check if already decided
+if test "x$want_vte" = "x"; then
+    # VTE support
+    AC_ARG_ENABLE(vte, AC_HELP_STRING([--enable-vte],
+     [enable if you want virtual termninal support [[default=yes]]]),
+     [want_vte="$enableval"], [want_vte="yes"])
+    if test "x$want_vte" = "xyes"; then
+    	AC_DEFINE(HAVE_VTE, 1, [Define if you want VTE support])
+    fi
+    AC_ARG_WITH(vte-module-path, AC_HELP_STRING([--with-vte-module-path=PATH],
+     [Path to a loadable libvte [[default=None]]]), [AC_DEFINE_UNQUOTED([VTE_MODULE_PATH],
+     ["$withval"], [Path to a loadable libvte])])
+fi
 
 GTK_VERSION=`$PKG_CONFIG --modversion gtk+-2.0`
 
