Index: tk/build.sh
==================================================================
--- tk/build.sh
+++ tk/build.sh
@@ -52,14 +52,21 @@
 	else    
 		cp -rp ../buildsrc/* './'
 	fi
 
 	cd "${BUILDDIR}" || exit 1
-	for dir in unix win macosx __fail__; do
+	for dir in unix win macosx win64 __fail__; do
 		if [ "${dir}" = "__fail__" ]; then
 			exit 1
 		fi
+
+		# Windows/amd64 workarounds
+		win64="0"
+		if [ "${dir}" = "win64" ]; then
+			win64="1"
+			dir="win"
+		fi
 
 		# Remove previous directory's "tkConfig.sh" if found
 		rm -f 'tkConfig.sh'
 
 		cd "${BUILDDIR}/${dir}" || exit 1
@@ -66,10 +73,17 @@
 
 		if [ "${dir}" = "win" ]; then
 			# Statically link Tk to Tclkit if we are compiling for
 			# Windows
 			STATICTK="1"
+
+			if [ "${win64}" = "1" ]; then
+				# Mingw32 for AMD64 requires this, apparently
+				CPPFLAGS="${CPPFLAGS} -D_WIN32_IE=0x0501"
+				CFLAGS="${CFLAGS} -D_WIN32_IE=0x0501"
+				export CPPFLAGS CFLAGS
+			fi
 		fi
 
 		if [ "${STATICTK}" = "1" ]; then
 			echo "Running: ./configure --disable-shared --disable-symbols --prefix=\"${INSTDIR}\" --with-tcl=\"${TCLCONFIGDIR}\" ${CONFIGUREEXTRA}"
 			./configure --disable-shared --disable-symbols --prefix="${INSTDIR}" --with-tcl="${TCLCONFIGDIR}" ${CONFIGUREEXTRA}