X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=aclocal.m4;h=0e9f4579dc0eb077177cae2ecf8e9564e46537c9;hb=55bc3c39930c71f5d5221634782676310a7c25e4;hp=c5fd6920c5a26f8bc578b11a4407ba445a3d3e58;hpb=9449208ea73782c753a2305e251c6ba8d6ec1eb3;p=ghc-hetmet.git diff --git a/aclocal.m4 b/aclocal.m4 index c5fd692..0e9f457 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -263,7 +263,7 @@ fi AC_CACHE_CHECK([for version of happy], fptools_cv_happy_version, changequote(, )dnl [if test x"$HappyCmd" = x"$SrcTreeHappyCmd" -a -e $srcdir/happy/mk/version.mk; then - fptools_cv_happy_version=`grep '^ProjectVersion[ ]*=' $srcdir/happy/mk/version.mk | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`; + fptools_cv_happy_version=`grep '^ProjectVersion[ ]*=' $srcdir/happy/mk/version.mk | sed 's/[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`; elif test x"$HappyCmd" != x; then fptools_cv_happy_version="`$HappyCmd -v | grep 'Happy Version' | sed -e 's/Happy Version \([^ ]*\).*/\1/g'`" ; @@ -330,7 +330,7 @@ fi AC_CACHE_CHECK([for version of alex], fptools_cv_alex_version, changequote(, )dnl [if test x"$AlexCmd" = x"$SrcTreeAlexCmd"; then - fptools_cv_alex_version=`grep '^ProjectVersion[ ]*=' $srcdir/alex/mk/version.mk | sed 's/.*\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`; + fptools_cv_alex_version=`grep '^ProjectVersion[ ]*=' $srcdir/alex/mk/version.mk | sed 's/[^0-9]*\([0-9][0-9]*\.[0-9][0-9]*\).*/\1/g'`; elif test x"$AlexCmd" != x; then fptools_cv_alex_version="`$AlexCmd -v | grep 'Alex [Vv]ersion' | sed -e 's/Alex [Vv]ersion \([0-9\.]*\).*/\1/g'`" ; @@ -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