+# * - making sure you've initially set BIN_DIST=1 in
+# your build.mk ...
+#
+# User tweakables
+# (settable via environment variables, e.g.,
+# mingw_top=<whatever> ../distrib/prep-bin-dist-mingw
+# )
+#
+# - mingw_top -- location of mingw distribution tree
+# - old_ghc_top -- top of existing GHC binary diste tree
+# (needed just to copy along perl binary.)
+#
+# - gcc_version -- what gcc version your mingw tree uses.
+#
+#
+if [ "x${old_ghc_top}" == "x" ]; then
+ export old_ghc_top=c:/ghc/ghc-6.2.1
+fi
+if [ "x${mingw_top}" == "x" ]; then
+ export mingw_top=c:/mingw3
+fi
+
+# The gcc-lib directory of the mingw tree you want to
+# include with the binary dist.
+if [ "x${gcc_lib}" == "x" ]; then
+ if [ "x${gcc_version}" == "x" ]; then
+ # The default (with mingw3)
+ export gcc_lib=$mingw_top/lib/gcc-lib/mingw32/3.2.3
+ else
+ export gcc_lib=$mingw_top/lib/gcc-lib/mingw32/${gcc_version}
+ fi
+fi
+if [ "x${gcc_libexec}" == "x" ]; then
+ if [ "x${gcc_version}" == "x" ]; then
+ # The default (with mingw3)
+ export gcc_libexec=$mingw_top/lib/gcc-lib/mingw32/3.2.3
+ else
+ if [ -d $mingw_top/lib/gcc-lib/mingw32/${gcc_version} ]; then
+ export gcc_libexec=$mingw_top/lib/gcc-lib/mingw32/${gcc_version}
+ elif [ -d $mingw_top/libexec/gcc/mingw32/${gcc_version} ]; then
+ export gcc_libexec=$mingw_top/libexec/gcc/mingw32/${gcc_version}
+ else
+ echo "WARNING: Unable to determine location of your gcc 'libexec' directory"
+ export gcc_libexec=$mingw_top/lib/gcc-lib/mingw32/${gcc_version}
+ fi
+ fi
+fi
+
+#Directory where a (cygwin-free) perl binary resides.
+if [ "x${perl_dir}" == "x" ]; then
+ export perl_dir=$old_ghc_top
+fi
+
+#
+# The mingw include, lib, and bin directories; all derived
+# from ${mingw_top}.
+#
+if [ "x${mingw_include}" == "x" ]; then
+ export mingw_include=$mingw_top/include
+fi
+if [ "x${mingw_lib}" == "x" ]; then
+ export mingw_lib=$mingw_top/lib
+fi
+if [ "x${mingw_bin}" == "x" ]; then
+ export mingw_bin=$mingw_top/bin
+fi