X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=aclocal.m4;h=f8202bf0356b1572c307752fca9acf42e72020cf;hb=426d9b8565b66eeb7d27725e8823784769cfca48;hp=139a26260106fdcee4a54eeef6bf50eb6e4955fc;hpb=0065d5ab628975892cea1ec7303f968c3338cbe1;p=ghc-hetmet.git diff --git a/aclocal.m4 b/aclocal.m4 index 139a262..f8202bf 100644 --- a/aclocal.m4 +++ b/aclocal.m4 @@ -245,26 +245,10 @@ dnl at least Happy version 1.14. If there's no installed Happy, we look dnl for a happy source tree and point the build system at that instead. dnl AC_DEFUN([FPTOOLS_HAPPY], -[ -if test -d $srcdir/happy; then - SrcTreeHappyCmd=$hardtop/happy/src/happy-inplace -else - SrcTreeHappyCmd="" -fi -if test x"$UseSrcTreeHappy" = xYES; then - if test x"$SrcTreeHappyCmd" != x; then - HappyCmd=$SrcTreeHappyCmd - else - AC_MSG_ERROR([--enable-src-tree-happy given, but happy not found in source tree]) - fi -else - AC_PATH_PROG(HappyCmd,happy,$SrcTreeHappyCmd) -fi +[AC_PATH_PROG(HappyCmd,happy,) 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][0-9]*\).*/\1/g'`; -elif test x"$HappyCmd" != x; then +[if test x"$HappyCmd" != x; then fptools_cv_happy_version="`$HappyCmd -v | grep 'Happy Version' | sed -e 's/Happy Version \([^ ]*\).*/\1/g'`" ; else @@ -272,10 +256,8 @@ else fi; changequote([, ])dnl ]) -if test -d $srcdir/ghc -a ! -f $srcdir/ghc/compiler/parser/Parser.hs; then - FP_COMPARE_VERSIONS([$fptools_cv_happy_version],[-lt],[1.15], +FP_COMPARE_VERSIONS([$fptools_cv_happy_version],[-lt],[1.15], [AC_MSG_ERROR([Happy version 1.15 or later is required to compile GHC.])])[]dnl -fi HappyVersion=$fptools_cv_happy_version; AC_SUBST(HappyVersion) ]) @@ -285,21 +267,7 @@ dnl Check for Haddock and version. If there's no installed Haddock, we look dnl for a haddock source tree and point the build system at that instead. dnl AC_DEFUN([FPTOOLS_HADDOCK], -[ -if test -d $srcdir/haddock; then - SrcTreeHaddockCmd=$hardtop/haddock/src/haddock-inplace -else - SrcTreeHaddockCmd="" -fi -if test x"$UseSrcTreeHaddock" = xYES; then - if test x"$SrcTreeHaddockCmd" != x; then - HaddockCmd=$SrcTreeHaddockCmd - else - AC_MSG_ERROR([--enable-src-tree-haddock given, but haddock not found in source tree]) - fi -else - AC_PATH_PROG(HaddockCmd,haddock,$SrcTreeHaddockCmd) -fi +[AC_PATH_PROG(HaddockCmd,haddock,) dnl Darn, I forgot to make Haddock print out its version number when dnl invoked with -v. We could try generating some HTML and grepping dnl through that to find the version number, but I think we'll make @@ -313,25 +281,10 @@ dnl for a alex source tree and point the build system at that instead. dnl AC_DEFUN([FPTOOLS_ALEX], [ -if test -d $srcdir/alex; then - SrcTreeAlexCmd=$hardtop/alex/src/alex-inplace -else - SrcTreeAlexCmd="" -fi -if test x"$UseSrcTreeAlex" = xYES; then - if test x"$SrcTreeAlexCmd" != x; then - AlexCmd=$SrcTreeAlexCmd - else - AC_MSG_ERROR([--enable-src-tree-alex given, but alex not found in source tree]) - fi -else - AC_PATH_PROG(AlexCmd,alex,$SrcTreeAlexCmd) -fi +AC_PATH_PROG(AlexCmd,alex,) 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][0-9]*\).*/\1/g'`; -elif test x"$AlexCmd" != x; then +[if 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'`" ; else @@ -339,10 +292,8 @@ else fi; changequote([, ])dnl ]) -if test -d $srcdir/ghc -a ! -f $srcdir/ghc/compiler/parser/Lexer.hs; then - FP_COMPARE_VERSIONS([$fptools_cv_alex_version],[-lt],[2.0], +FP_COMPARE_VERSIONS([$fptools_cv_alex_version],[-lt],[2.0], [AC_MSG_ERROR([Alex version 2.0 or later is required to compile GHC.])])[]dnl -fi AlexVersion=$fptools_cv_alex_version; AC_SUBST(AlexVersion) ]) @@ -1079,18 +1030,30 @@ AC_SUBST([GhcHasReadline], [`echo $fp_cv_ghc_has_readline | sed 'y/yesno/YESNO/' AC_DEFUN([FP_GCC_NEEDS_NO_OMIT_LFPTR], [AC_REQUIRE([FP_HAVE_GCC]) AC_CACHE_CHECK([whether gcc needs -mno-omit-leaf-frame-pointer], [fp_cv_gcc_needs_no_omit_lfptr], -[FP_COMPARE_VERSIONS([$gcc_version_str], [-ge], [3.2], +[FP_COMPARE_VERSIONS([$fp_gcc_version], [-ge], [3.2], [fp_cv_gcc_needs_no_omit_lfptr=yes], [fp_cv_gcc_needs_no_omit_lfptr=no])]) if test "$fp_cv_gcc_needs_no_omit_lfptr" = "yes"; then AC_DEFINE([HAVE_GCC_MNO_OMIT_LFPTR], [1], [Define to 1 if gcc supports -mno-omit-leaf-frame-pointer.]) fi])# FP_GCC_NEEDS_NO_OMIT_LFPTR +# FP_GCC_HAS_NO_UNIT_AT_A_TIME +# -------------------------- +AC_DEFUN([FP_GCC_HAS_NO_UNIT_AT_A_TIME], +[AC_REQUIRE([FP_HAVE_GCC]) +AC_CACHE_CHECK([whether gcc has -fno-unit-at-a-time], [fp_cv_gcc_has_no_unit_at_a_time], +[FP_COMPARE_VERSIONS([$fp_gcc_version], [-ge], [3.4], + [fp_cv_gcc_has_no_unit_at_a_time=yes], + [fp_cv_gcc_has_no_unit_at_a_time=no])]) +if test "$fp_cv_gcc_has_no_unit_at_a_time" = "yes"; then + AC_DEFINE([HAVE_GCC_HAS_NO_UNIT_AT_A_TIME], [1], [Define to 1 if gcc supports -fno-unit-at-a-time.]) +fi]) # FP_SETUP_PROJECT_VERSION # --------------------- AC_DEFUN([FP_SETUP_PROJECT_VERSION], [# Some renamings +AC_SUBST([ProjectName], [$PACKAGE_NAME]) AC_SUBST([ProjectVersion], [$PACKAGE_VERSION]) # Split PACKAGE_VERSION into (possibly empty) parts @@ -1114,6 +1077,6 @@ test -z "$ProjectPatchLevel" && ProjectPatchLevel=0 ProjectPatchLevel=`echo $ProjectPatchLevel | sed 's/\.//'` AC_SUBST([ProjectPatchLevel]) -])# FP_SETUP_PROJECT_INFO +])# FP_SETUP_PROJECT_VERSION # LocalWords: fi