-
-#Directory where a (cygwin-free) perl binary resides.
-if [ "x${perl_dir}" == "x" ]; then
- export perl_dir=$old_ghc_top
+
+# The gcc-lib directory of the mingw tree you want to
+# include with the binary dist.
+if [ "x${gcc_libexec}" == "x" ]; then
+ if [ -d "${mingw_top}/libexec/gcc-lib/mingw32" ]; then
+ mingw_gcc_libexec=${mingw_top}/libexec/gcc-lib/mingw32
+ else
+ mingw_gcc_libexec=${mingw_top}/libexec/gcc/mingw32
+ fi
+ for i in `ls -r ${mingw_gcc_libexec}`; do
+ if [ -d "${mingw_gcc_libexec}/$i" ]; then
+ gcc_libexec=${mingw_gcc_libexec}/$i
+ echo "Found gcc libexec in $gcc_libexec"
+ break
+ fi
+ done
+ if [ "${gcc_libexec}" == "" ]; then
+ echo "Can't find gcc libexec files; please set \$gcc_libexec"
+ exit 1
+ fi