--- moz/makefile.mk.orig	2005-09-07 21:59:19.000000000 +0200
+++ moz/makefile.mk	2005-10-14 17:30:15.684000000 +0200
@@ -79,8 +79,17 @@
 PATCH_FILE_NAME=mozilla-source-$(MOZILLA_VERSION).patch 
 
 # These files are needed for the W32 build when BUILD_MOZAB is set
+LIBIDL_VERSION*=0.6.8
+LIBIDL_DLLVERSION*=0.6
+LIBIDL_PATCH_NAME*=libIDL-$(LIBIDL_VERSION)-ooo.patch
+LIBIDL_SRCTAR_NAME*=libIDL-$(LIBIDL_VERSION).tar.gz
 LIBIDL_VC71_ZIPFILE_NAME*=vc71-libIDL-0.6.8-bin.zip
+LIBGLIB_VERSION*=1.2.10
+LIBGLIB_DLLVERSION*=1.2
+LIBGLIB_PATCH_NAME*=glib-$(LIBGLIB_VERSION)-ooo.patch
+LIBGLIB_SRCTAR_NAME*=glib-$(LIBGLIB_VERSION).tar.gz
 LIBGLIB_VC71_ZIPFILE_NAME*=vc71-glib-1.2.10-bin.zip
+MOZILLA_MAKE_VER=3.79.1
 WINTOOLS_ZIPFILE_NAME*=wintools.zip
 
 ADDITIONAL_FILES=mailnews$/addrbook$/src$/nsAbMD5sum.cpp
@@ -234,15 +243,107 @@
 	+cd $(MOZTOOLSUNPACK)$/buildtools$/windows && $(SET_MOZ_TOOLS_INSTALL_BAT) && cmd /c install.bat
 	+$(TOUCH) $(MISC)$/build$/wintools.install
 
-$(MISC)$/build$/wintools.complete : \
-  $(MISC)$/build$/wintools.install \
-  $(PRJ)$/download$/$(LIBIDL_VC71_ZIPFILE_NAME) \
-  $(PRJ)$/download$/$(LIBGLIB_VC71_ZIPFILE_NAME)
-	unzip $(PRJ)$/download$/$(LIBIDL_VC71_ZIPFILE_NAME) -d $(MOZTOOLSINST)
-	unzip $(PRJ)$/download$/$(LIBGLIB_VC71_ZIPFILE_NAME) -d $(MOZTOOLSINST)
+$(MISC)$/build$/glib.build : \
+  $(PRJ)$/download$/$(LIBGLIB_SRCTAR_NAME)
+	[
+	tar --directory $(MOZTOOLSUNPACK) -xzf $(PRJ)$/download$/$(LIBGLIB_SRCTAR_NAME)
+.IF "$(USE_SHELL)"=="bash"
+	ABSPRJ=`cygpath -a $(PRJ)`
+.ELSE
+	set ABSPRJ=`cygpath -a $(PRJ)`
+.ENDIF
+	cd $(MOZTOOLSUNPACK)$/glib-$(LIBGLIB_VERSION)
+	patch -p1 < $$ABSPRJ$/download$/$(LIBGLIB_PATCH_NAME)
+	nmake -f Makefile.msc
+	cd $$ABSPRJ
+	$(TOUCH) $(MISC)$/build$/glib.build
+	]
+
+$(MISC)$/build$/libIDL.build : \
+  $(MISC)$/build$/glib.build \
+  $(PRJ)$/download$/$(LIBIDL_SRCTAR_NAME)
+	[
+	tar --directory $(MOZTOOLSUNPACK) -xzf $(PRJ)$/download$/$(LIBIDL_SRCTAR_NAME)
+.IF "$(USE_SHELL)"=="bash"
+	ABSPRJ=`cygpath -a $(PRJ)`
+.ELSE
+	set ABSPRJ=`cygpath -a $(PRJ)`
+.ENDIF
+	cd $(MOZTOOLSUNPACK)$/libIDL-$(LIBIDL_VERSION)
+	patch -p1 < $$ABSPRJ$/download$/$(LIBIDL_PATCH_NAME)
+	nmake -f Makefile.msc libIDL-$(LIBIDL_DLLVERSION).dll
+	cd $$ABSPRJ
+	$(TOUCH) $(MISC)$/build$/libIDL.build
+	]
+
+$(MISC)$/build$/make.build : $(MISC)$/build$/wintools.unpack
+	+cd $(MOZTOOLSUNPACK)$/buildtools$/windows$/source$/make-$(MOZILLA_MAKE_VER) && nmake -f NMakefile
+	$(TOUCH) $(MISC)$/build$/make.build
+
+$(MISC)$/build$/shmsdos.build : $(MISC)$/build$/wintools.unpack
+	+cd $(MOZTOOLSUNPACK)$/buildtools$/windows$/source$/shmsdos && nmake -f shmsdos.mak && nmake -f nsinstall.mak
+	$(TOUCH) $(MISC)$/build$/shmsdos.build
+
+$(MISC)$/build$/uname.build : $(MISC)$/build$/wintools.unpack
+	+cd $(MOZTOOLSUNPACK)$/buildtools$/windows$/source$/uname && nmake -f uname.mak
+	$(TOUCH) $(MISC)$/build$/uname.build
+
+LIBVC71_BINFILESLIST+=	\
+	glib-$(LIBGLIB_VERSION)$/glib-$(LIBGLIB_DLLVERSION).dll	\
+	glib-$(LIBGLIB_VERSION)$/gmodule-$(LIBGLIB_DLLVERSION).dll	\
+	libIDL-$(LIBIDL_VERSION)$/libIDL-$(LIBIDL_DLLVERSION).dll
+
+LIBVC71_INCLUDEFILESLIST+=	\
+	glib-$(LIBGLIB_VERSION)$/glib.h	\
+	glib-$(LIBGLIB_VERSION)$/glibconfig.h
+
+LIBVC71_LIBFILESLIST+=	\
+	glib-$(LIBGLIB_VERSION)$/glib-$(LIBGLIB_DLLVERSION).lib	\
+	glib-$(LIBGLIB_VERSION)$/gmodule-$(LIBGLIB_DLLVERSION).lib	\
+	libIDL-$(LIBIDL_VERSION)$/libIDL-$(LIBIDL_DLLVERSION).lib
+
+$(MISC)$/build$/wintools.build : \
+  $(MISC)$/build$/glib.build \
+  $(MISC)$/build$/libIDL.build \
+  $(MISC)$/build$/make.build \
+  $(MISC)$/build$/shmsdos.build \
+  $(MISC)$/build$/uname.build
 # chmod is also needed for W32-4nt build (when cygwin unzip is used)
+	@+-$(MKDIR) -p $(MOZTOOLSINST)$/bin
+	@+-$(MKDIR) -p $(MOZTOOLSINST)$/include
+	@+-$(MKDIR) -p $(MOZTOOLSINST)$/lib
+	@+-$(MKDIR) -p $(MOZTOOLSINST)$/vc71$/bin
+	@+-$(MKDIR) -p $(MOZTOOLSINST)$/vc71$/include
+	@+-$(MKDIR) -p $(MOZTOOLSINST)$/vc71$/include$/libIDL
+	@+-$(MKDIR) -p $(MOZTOOLSINST)$/vc71$/lib
+	+$(foreach,file,$(LIBVC71_BINFILESLIST) $(COPY) $(MOZTOOLSUNPACK)$/$(file) \
+	  $(MOZTOOLSINST)$/vc71$/bin &&) \
+	  echo >& $(NULLDEV)
+	+$(foreach,file,$(LIBVC71_INCLUDEFILESLIST) $(COPY) $(MOZTOOLSUNPACK)$/$(file) \
+	  $(MOZTOOLSINST)$/vc71$/include &&) \
+	  echo >& $(NULLDEV)
+	+$(COPY) $(MOZTOOLSUNPACK)$/libIDL-$(LIBIDL_VERSION)$/IDL.h $(MOZTOOLSINST)$/vc71$/include$/libIDL
+	+$(foreach,file,$(LIBVC71_LIBFILESLIST) $(COPY) $(MOZTOOLSUNPACK)$/$(file) \
+	  $(MOZTOOLSINST)$/vc71$/lib &&) \
+	  echo >& $(NULLDEV)
+	+$(COPY) -p $(MOZTOOLSUNPACK)$/buildtools$/windows$/source$/make-$(MOZILLA_MAKE_VER)$/WinRel/make.exe \
+	  $(MOZTOOLSINST)$/bin$/gmake.exe
+	+$(COPY) -p $(MOZTOOLSUNPACK)$/buildtools$/windows$/source$/make-$(MOZILLA_MAKE_VER)$/acconfig.h \
+	  $(MOZTOOLSUNPACK)$/buildtools$/windows$/source$/make-$(MOZILLA_MAKE_VER)$/config.h \
+	  $(MOZTOOLSINST)$/include
+	+$(COPY) -p \
+	  $(MOZTOOLSUNPACK)$/buildtools$/windows$/source$/shmsdos$/Release$/shmsdos.exe \
+	  $(MOZTOOLSUNPACK)$/buildtools$/windows$/source$/shmsdos$/Release$/nsinstall.exe \
+	  $(MOZTOOLSUNPACK)$/buildtools$/windows$/source$/uname$/Release$/uname.exe \
+	  $(MOZTOOLSINST)$/bin
 	-chmod -R +x $(MOZTOOLSINST)$/vc71$/bin
+	+$(TOUCH) $(MISC)$/build$/wintools.build
+
+$(MISC)$/build$/wintools.complete : \
+  $(MISC)$/build$/wintools.unpack \
+  $(MISC)$/build$/wintools.build
 	+$(TOUCH) $(MISC)$/build$/wintools.complete
+
 .ENDIF # "$(GUI)"=="WNT"
 
 zip:	\
--- config_office/configure.in	2005-10-13 10:31:41.000000000 +0200
+++ config_office/configure.in	2005-10-14 18:35:17.449625000 +0200
@@ -2877,13 +2913,14 @@
    fi 
    if test "$_os" = "WINNT"; then
       AC_MSG_CHECKING([for glib and libIDL binaries])
-      if test ! -e "../moz/download/vc71-glib-1.2.10-bin.zip" \
-           -o ! -e "../moz/download/vc71-libIDL-0.6.8-bin.zip" \
+      if test ! -e "../moz/download/glib-1.2.10.tar.gz" \
+           -o ! -e "../moz/download/libIDL-0.6.8.tar.gz" \
            -o ! -e "../moz/download/wintools.zip" ; then
 AC_MSG_ERROR([One or more of the following archives is missing in moz/download/
-  vc71-glib-1.2.10-bin.zip
-  vc71-libIDL-0.6.8-bin.zip
-(from ftp://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/win32/historic/vc71/)
+  glib-1.2.10.tar.gz
+(from ftp://ftp.gtk.org/pub/gtk/v1.2/)
+  libIDL-0.6.8.tar.gz
+(from ftp://ftp.mozilla.org/pub/mozilla.org/mozilla/libraries/source/)
   wintools.zip
 (from http://ftp.mozilla.org/pub/mozilla.org/mozilla/source/wintools.zip)])
       else
