dnl dnl Author : Don Stewart dnl Created : Sun Aug 18 11:38:32 EST 2002 dnl Last mod: Thu Feb 27 14:50:10 EST 2003 dnl dnl sanity test AC_INIT(main/Main.hs) dnl Some necessary tools AC_PATH_PROG(GHC,ghc) if test -z "$GHC" ; then AC_MSG_ERROR([You need the GHC to build the stgjvm project!]) fi AC_PATH_PROG(HAPPY,happy) if test -z "$HAPPY" ; then AC_MSG_ERROR([You need Happy to build the stgjvm project!]) fi AC_PATH_PROG(MAKE,make) if test -z "$MAKE" ; then AC_MSG_ERROR([Holy guacamole! No make!]) fi AC_PATH_PROG(SHELL,sh) if test -z "$SHELL" ; then AC_MSG_ERROR([Holy guacamole! No sh! What kind of OS is this?]) fi AC_PATH_PROG(PERL,perl) if test -z "$PERL" ; then echo "You'll need perl if you want to test the compiler." fi AC_PATH_PROG(SED,sed) if test -z "$SED" ; then AC_MSG_ERROR([Adios compadre! Sed is dead. Or missing...]) fi AC_PATH_PROG(CP,cp) if test -z "$CP" ; then AC_MSG_ERROR([What the?! No cp!]) fi AC_PATH_PROG(FIND,find) if test -z "$FIND" ; then AC_MSG_ERROR([What the?! No find!]) fi AC_PATH_PROG(DIFF,diff) if test -z "$DIFF" ; then echo "You'll need diff if you want to test the compiler." fi AC_PATH_PROG(LATEX,latex) if test -z "$LATEX" ; then echo "You'll need latex if you want to build the documentation." fi AC_PATH_PROG(DVIPS,dvips) if test -z "$DVIPS" ; then echo "You'll need dvips if you want postscript documentation." fi dnl From the CTK configure script, cheers Manuel. dnl Check GHC's details. dnl dnl What we are interested in is whether we can use -ga with happy. dnl which means we need 5.02 > dnl dnl I also suspect that it would be hard for people with GHC < 4.08, so dnl we set that as an (arbitrary) limit on things dnl if test -x "$GHC"; then dnl Getting the version number is a bit subtle, as GHC insists on dnl omitting the patchlevel for patchlevel 0 - so, there may be two dnl or three numbers. AC_CACHE_CHECK([ghc version], prog_ghc_version, [ prog_ghc_version=`$GHC --version 2>&1 |\ $PERL -pe 's/.* (\d+)\.(\d+).*/\1.\2/'` ]) MAJOR=`echo $prog_ghc_version | $PERL -pe 's/(\d+).*/\1/'` MINOR=`echo $prog_ghc_version | $PERL -pe 's/\d+.(\d+).*/\1/'` if test $MAJOR -ne 6 ; then AC_MSG_ERROR([I decree that you need at least version 6.00 GHC!]) fi fi dnl dnl the whole point of this excerise was to determine if we can use -ga, dnl without resorting to hacky, non-platform independent tricks.thus: dnl if test $MAJOR -eq 5 -a $MINOR -ge 2 ; then HAPPY_FLAGS="-ga" fi dnl dnl needed by hs2java dnl BIN_DIR=`pwd` dnl write out some vars AC_SUBST(HAPPY_FLAGS) AC_SUBST(BIN_DIR) dnl write up our results AC_CONFIG_FILES(Makefile parser/Makefile doc/Makefile util/check util/happytex util/stgpp driver/hsjava) AC_CONFIG_COMMANDS([default], [chmod 700 util/check util/happytex util/stgpp driver/hsjava] ) AC_OUTPUT