Commit 1d00c839 authored by Ian Lynagh's avatar Ian Lynagh

Support making a Win64 in-tree mingw

The Win64 mingw zip file isn't in the ghc-tarballs repo, as it's >300M.
parent 45a40bab
......@@ -252,57 +252,73 @@ if test "$HostOS" = "mingw32"
then
test -d inplace || mkdir inplace
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"
# NB. If you update the tarballs to a new version of gcc, don't
# forget to tweak the paths in driver/gcc/gcc.c.
if ! test -d inplace/mingw ||
test inplace/mingw -ot ghc-tarballs/mingw/binutils*.tar.lzma ||
test inplace/mingw -ot ghc-tarballs/mingw/gcc-core*.tar.lzma ||
test inplace/mingw -ot ghc-tarballs/mingw/gcc-c++*.tar.lzma ||
test inplace/mingw -ot ghc-tarballs/mingw/libgcc*.tar.gz ||
test inplace/mingw -ot ghc-tarballs/mingw/libgmp*.tar.gz ||
test inplace/mingw -ot ghc-tarballs/mingw/libmpc*.tar.gz ||
test inplace/mingw -ot ghc-tarballs/mingw/libmpfr*.tar.gz ||
test inplace/mingw -ot ghc-tarballs/mingw/libstdc*.tar.lzma ||
test inplace/mingw -ot ghc-tarballs/mingw/mingwrt*-dev.tar.gz ||
test inplace/mingw -ot ghc-tarballs/mingw/mingwrt*-dll.tar.gz ||
test inplace/mingw -ot ghc-tarballs/mingw/w32api*.tar.lzma
if test "$HostOS" = "i386"
then
AC_MSG_NOTICE([Making in-tree mingw tree])
rm -rf inplace/mingw
mkdir inplace/mingw
(
cd inplace/mingw &&
tar --lzma -xf ../../ghc-tarballs/mingw/binutils*.tar.lzma &&
tar --lzma -xf ../../ghc-tarballs/mingw/gcc-core*.tar.lzma &&
tar --lzma -xf ../../ghc-tarballs/mingw/gcc-c++*.tar.lzma &&
tar --lzma -xf ../../ghc-tarballs/mingw/libgcc*.tar.lzma &&
tar --lzma -xf ../../ghc-tarballs/mingw/libgmp*.tar.lzma &&
tar --lzma -xf ../../ghc-tarballs/mingw/libmpc*.tar.lzma &&
tar --lzma -xf ../../ghc-tarballs/mingw/libmpfr*.tar.lzma &&
tar --lzma -xf ../../ghc-tarballs/mingw/libstdc*.tar.lzma &&
tar -z -xf ../../ghc-tarballs/mingw/mingwrt*-dev.tar.gz &&
tar -z -xf ../../ghc-tarballs/mingw/mingwrt*-dll.tar.gz &&
tar --lzma -xf ../../ghc-tarballs/mingw/w32api*.tar.lzma &&
mv bin/gcc.exe bin/realgcc.exe
)
PATH=`pwd`/inplace/mingw/bin:$PATH 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
if ! test -e inplace/mingw/bin/gcc.exe
# NB. If you update the tarballs to a new version of gcc, don't
# forget to tweak the paths in driver/gcc/gcc.c.
if ! test -d inplace/mingw ||
test inplace/mingw -ot ghc-tarballs/mingw/binutils*.tar.lzma ||
test inplace/mingw -ot ghc-tarballs/mingw/gcc-core*.tar.lzma ||
test inplace/mingw -ot ghc-tarballs/mingw/gcc-c++*.tar.lzma ||
test inplace/mingw -ot ghc-tarballs/mingw/libgcc*.tar.gz ||
test inplace/mingw -ot ghc-tarballs/mingw/libgmp*.tar.gz ||
test inplace/mingw -ot ghc-tarballs/mingw/libmpc*.tar.gz ||
test inplace/mingw -ot ghc-tarballs/mingw/libmpfr*.tar.gz ||
test inplace/mingw -ot ghc-tarballs/mingw/libstdc*.tar.lzma ||
test inplace/mingw -ot ghc-tarballs/mingw/mingwrt*-dev.tar.gz ||
test inplace/mingw -ot ghc-tarballs/mingw/mingwrt*-dll.tar.gz ||
test inplace/mingw -ot ghc-tarballs/mingw/w32api*.tar.lzma
then
AC_MSG_ERROR([GHC is required unless bootstrapping from .hc files.])
AC_MSG_NOTICE([Making in-tree mingw tree])
rm -rf inplace/mingw
mkdir inplace/mingw
(
cd inplace/mingw &&
tar --lzma -xf ../../ghc-tarballs/mingw/binutils*.tar.lzma &&
tar --lzma -xf ../../ghc-tarballs/mingw/gcc-core*.tar.lzma &&
tar --lzma -xf ../../ghc-tarballs/mingw/gcc-c++*.tar.lzma &&
tar --lzma -xf ../../ghc-tarballs/mingw/libgcc*.tar.lzma &&
tar --lzma -xf ../../ghc-tarballs/mingw/libgmp*.tar.lzma &&
tar --lzma -xf ../../ghc-tarballs/mingw/libmpc*.tar.lzma &&
tar --lzma -xf ../../ghc-tarballs/mingw/libmpfr*.tar.lzma &&
tar --lzma -xf ../../ghc-tarballs/mingw/libstdc*.tar.lzma &&
tar -z -xf ../../ghc-tarballs/mingw/mingwrt*-dev.tar.gz &&
tar -z -xf ../../ghc-tarballs/mingw/mingwrt*-dll.tar.gz &&
tar --lzma -xf ../../ghc-tarballs/mingw/w32api*.tar.lzma &&
mv bin/gcc.exe bin/realgcc.exe
)
PATH=`pwd`/inplace/mingw/bin:$PATH 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
AC_MSG_NOTICE([In-tree mingw tree created])
mingwbin="$hardtop/inplace/mingw/bin/"
else
# NB. If you update the tarballs to a new version of gcc, don't
# forget to tweak the paths in driver/gcc/gcc.c.
if ! test -d inplace/mingw ||
test inplace/mingw -ot ghc-tarballs/mingw64/x86_64-w64-*.zip
then
AC_MSG_NOTICE([Making in-tree mingw tree])
rm -rf inplace/mingw
mkdir inplace/mingw
(
cd inplace/mingw &&
unzip ../../ghc-tarballs/mingw64/x86_64-w64-*.zip
)
AC_MSG_NOTICE([In-tree mingw tree created])
fi
mingwbin="$hardtop/inplace/mingw/bin/x86_64-w64-mingw32-"
fi
CC="${mingwbin}gcc.exe"
LD="${mingwbin}ld.exe"
NM="${mingwbin}nm.exe"
fp_prog_ar_raw="${mingwbin}ar.exe"
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 &&
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment