X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=aclocal.m4;h=8f087d125e3045cb577efa2d8b181400d2178297;hb=ceefdee5e6de7ae96b461b4104c32779bbb58e53;hp=c5fd6920c5a26f8bc578b11a4407ba445a3d3e58;hpb=9449208ea73782c753a2305e251c6ba8d6ec1eb3;p=ghc-hetmet.git diff --git a/aclocal.m4 b/aclocal.m4 index c5fd692..8f087d1 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -557,18 +557,25 @@ rm -f conftest # output variables HaveGcc and GccVersion. AC_DEFUN([FP_HAVE_GCC], [AC_REQUIRE([AC_PROG_CC]) -AC_CACHE_CHECK([whether your gcc is OK], [fp_cv_have_gcc], -[if test -z "$GCC"; then - fp_cv_have_gcc='no' - AC_MSG_WARN([You would be better off with gcc, perhaps it is already installed, but not in your PATH?]) +if test -z "$GCC"; then + fp_have_gcc=NO else - fp_cv_have_gcc='yes' - gcc_version_str="`$CC -v 2>&1 | grep 'version ' | sed -e 's/.*version [[^0-9]]*\([[0-9]][[0-9]]*\)\.\([[0-9]][[0-9]]*\).*/\1\.\2/g' `" - FP_COMPARE_VERSIONS([$gcc_version_str], [-lt], [2.0], - [AC_MSG_ERROR([Need at least gcc version 2.0 (2.95.3 recommend)])]) -fi]) -AC_SUBST([HaveGcc], [`echo $fp_cv_have_gcc | sed 'y/yesno/YESNO/'`]) -AC_SUBST([GccVersion], [`gcc --version | grep mingw | cut -f 3 -d ' '`]) + fp_have_gcc=YES +fi +if test "$fp_have_gcc" = "NO" -a -d $srcdir/ghc; then + AC_MSG_ERROR([gcc is required]) +fi +AC_CACHE_CHECK([version of gcc], [fp_gcc_version], +[if test "$fp_have_gcc" = "YES"; then + fp_gcc_version="`$CC -v 2>&1 | grep 'version ' | sed -e 's/.*version [[^0-9]]*\([[0-9]][[0-9]]*\(\.[[0-9]][[0-9]]*\)*\).*/\1/g' `" + FP_COMPARE_VERSIONS([$fp_gcc_version], [-lt], [2.0], + [AC_MSG_ERROR([Need at least gcc version 2.0 (3.4+ recommended)])]) + else + fp_gcc_version="not-installed" + fi +]) +AC_SUBST([HaveGcc], [$fp_have_gcc]) +AC_SUBST([GccVersion], [$fp_gcc_version]) ])# FP_HAVE_GCC AC_DEFUN([FP_MINGW_GCC], @@ -641,6 +648,25 @@ AC_SUBST([FindCmd])[]dnl ])# FP_PROG_FIND +# FP_PROG_SORT +# ------------ +# Find a Unix-like sort +AC_DEFUN([FP_PROG_SORT], +[AC_PATH_PROG([fp_prog_sort], [sort]) +echo conwip > conftest.txt +$fp_prog_sort -f conftest.txt > conftest.out 2>&1 +if grep 'conwip' conftest.out > /dev/null 2>&1 ; then + # The goods + SortCmd="$fp_prog_sort" +else + # Summink else..pick next one. + AC_MSG_WARN([$fp_prog_sort looks like a non-*nix sort, ignoring it]) + FP_CHECK_PROG([SortCmd], [sort], [], [], [$fp_prog_sort]) +fi +rm -f conftest.txt conftest.out +AC_SUBST([SortCmd])[]dnl +])# FP_PROG_SORT + dnl dnl FPTOOLS_NOCACHE_CHECK prints a message, then sets the dnl values of the second argument to the result of running