- 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
+ 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