+# This uses GHC, so put it after the "GHC is required" check above:
+FP_FIND_ROOT
+
+if test "$HostOS" = "mingw32"
+then
+ CC="$hardtop/inplace/mingw/bin/gcc.exe"
+ LD="$hardtop/inplace/mingw/bin/ld.exe"
+ NM="$hardtop/inplace/mingw/bin/nm.exe"
+ fp_prog_ar_raw="$hardtop/inplace/mingw/bin/ar.exe"
+ if ! test -d inplace/mingw ||
+ test inplace/mingw -ot ghc-tarballs/mingw/binutils*.tar.gz ||
+ test inplace/mingw -ot ghc-tarballs/mingw/gcc-core*.tar.gz ||
+ test inplace/mingw -ot ghc-tarballs/mingw/gcc-g++*.tar.gz ||
+ test inplace/mingw -ot ghc-tarballs/mingw/libcrypt*.tar.bz2 ||
+ test inplace/mingw -ot ghc-tarballs/mingw/mingw-runtime*.tar.gz ||
+ test inplace/mingw -ot ghc-tarballs/mingw/w32api*.tar.gz
+ then
+ AC_MSG_NOTICE([Making in-tree mingw tree])
+ rm -rf inplace/mingw
+ mkdir inplace
+ mkdir inplace/mingw
+ (
+ cd inplace/mingw &&
+ tar -zxf ../../ghc-tarballs/mingw/binutils*.tar.gz &&
+ tar -zxf ../../ghc-tarballs/mingw/gcc-core*.tar.gz &&
+ tar -zxf ../../ghc-tarballs/mingw/gcc-g++*.tar.gz &&
+ tar -jxf ../../ghc-tarballs/mingw/libcrypt*.tar.bz2 &&
+ tar -zxf ../../ghc-tarballs/mingw/mingw-runtime*.tar.gz &&
+ tar -zxf ../../ghc-tarballs/mingw/w32api*.tar.gz &&
+ mv bin/gcc.exe bin/realgcc.exe
+ )
+ inplace/mingw/bin/realgcc.exe driver/gcc/gcc.c driver/utils/cwrapper.c driver/utils/getLocation.c -Idriver/utils -o inplace/mingw/bin/gcc.exe
+ AC_MSG_NOTICE([In-tree mingw tree created])
+ fi
+ if ! test -d inplace/perl ||
+ test inplace/perl -ot ghc-tarballs/perl/ghc-perl*.tar.gz
+ then
+ AC_MSG_NOTICE([Making in-tree perl tree])
+ rm -rf inplace/perl
+ mkdir inplace
+ mkdir inplace/perl
+ (
+ cd inplace/perl &&
+ tar -zxf ../../ghc-tarballs/perl/ghc-perl*.tar.gz
+ )
+ AC_MSG_NOTICE([In-tree perl tree created])
+ fi
+fi
+