rem unzip binaries to %driveletter%:\cygwin
rem unzip devo to %driveletter%:\src

rem SystemDrive must be set

set driveletter=c
%driveletter%:
set origpath=%path%

mkdir %driveletter%:\build1
mkdir %driveletter%:\cygwin\build1
mkdir %driveletter%:\stage1
mkdir %driveletter%:\stage1\tmp
mkdir %driveletter%:\stage1\src

rem Stage 1

set path=%driveletter%:\cygwin\bin;%origpath%
mount -f -b %driveletter%:/cygwin /
mount -f -b %driveletter%:/build1 /build1

cd \build1

sh -c "/bin/sh /src/configure --host=i686-cygwin --target=i686-cygwin --disable-threads --enable-haifa --prefix=/usr --exec-prefix=/usr --sysconfdir=/etc --bindir=/bin --includedir=/usr/include --libdir=/usr/lib > configure.log 2>&1"
sh -c "/bin/make all info > make.log 2>&1"

mount -f -b %driveletter%:/stage1 /
mount -f -b %driveletter%:/cygwin/src /src
mount -f -b -x %driveletter%:/cygwin/bin/sh.exe /bin/sh
%driveletter%:\cygwin\bin\sh -c "/cygdrive/%driveletter%/cygwin/bin/make install install-info > install.log 2>&1"

umount --remove-all-mounts

